logistf

error: 'object not found' in nested functions

不羁的心 提交于 2020-12-29 07:41:25
问题 I was writing a function using the logistf::logistf and logistf::forward function. I will give here a minimum working example using sex2 from the logistf package. data(sex2) fwSel <- function(datamod) { fitnull <- logistf(case ~ 1, data = datamod, pl = FALSE) fw <- forward(fitnull) return(fw) } fwSel(sex2) I get the following output: Step 0 : starting model Error in is.data.frame(data) : object 'datamod' not found`. Has anybody an explanation for that? 回答1: This is a typical error which you