[R] could not find function "flexsurvreg"

Rui Barradas ru|pb@rr@d@@ @end|ng |rom @@po@pt
Sat Oct 1 15:29:15 CEST 2022


Not knowing which system you have, here is a way that usually works.

1. If you are using an IDE sych as RStudio or RGui, save your work and 
exit. This is because when the packages' namepaces are loaded, the 
shared libs, if they exist, are blocked,

2. Open a terminal window
3. Run

R -q -e "install.packages(c('lifecycle', 'flexsurv'))"

The packages should now be installed.

Hope this helps,

Rui Barradas

Às 13:53 de 01/10/2022, Shah Alam escreveu:
> Dear All,
> I am analyzing trial data for survival. During the loading of the R package
> "flexsurv", the following error message appeared.
> "Loading required package: survival
> Error: package or namespace load failed for ‘flexsurv’ in loadNamespace(j
> <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
>   there is no package called ‘lifecycle’
> Despite installing lifecycle package, loading lifecycle package results in
> the following error message:
> Error in library(lifecycle) : there is no package called ‘lifecycle’
> Moreover, the flexsurvreg function in the flexsurv library also produces an
> error:
> Error in flexsurvreg(Surv(Time, Event) ~ 1, anc = NULL, data = data1,  :
>    could not find function "flexsurvreg"
> Several times I have installed and uninstalled packages, re-started R, but
> the error persists.
> Could anyone help me with the flexsurv package, why is it not working?
> Best regards,
> Shah
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list