1

I would like to include in my R package a new function, which requires the Surv function from the survival package. I did include import(survival) in the NAMESPACE and I have survival installed; however, when I run R CMD check, I still get this error message:

Error in Surv(time, status) : could not find function "Surv"

I do have dependencies from other packages and I never faced such an issue. I already tried with no success to implement the solutions recommended here:

http://r.789695.n4.nabble.com/requireNamespace-etiquette-td4703620.html

Any suggestions on what might be the problem?

  • It would be nice to have some sort of minimal [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) to test with. – MrFlick Oct 18 '17 at 14:43

1 Answers1

-1

You have to do the following

  1. install.packages("survival")
  2. library("survival")

and then the surv() function will work

tshimkus
  • 1,173
  • 2
  • 17
  • 24