I want to use the R package survival
in my own R package.
My problem is that the function predict.coxph
is not exported by survival
, which is why I cannot use survival::predict.coxph
listing survival under Imports:
in the DESCRIPTION
file.
Now I tried to list survival
under Depends:
and just use predict(fittedmodel)
(and coxph
and Surv
without survival::
). But I get the following NOTEs
using R CMD check --as-cran
:
- "* checking dependencies in R code ... NOTE Package in Depends field not imported from: 'survival' These packages need to be imported from (in the NAMESPACE file) for when this namespace is loaded but not attached."
- "no visible global function definition for 'Surv'" etc.
- "Undefined global functions or variables: Surv coxph survfit"
Regarding 1): I have import(survival)
in the NAMESPACE
file.
What would be the problem here?