Cannot download ggsurvfit R package, even with make.exe text file

30 views Asked by At

I've spent literally all day trying to download the package ggsurvfit to visualize a Kaplan-Meier survival distribution. I use Rstudio and I have RTools40 (does the file path of RTools40 matter?). I could also use tidycmprsk package but get similar problems. Please please help! You can see everything I've tried below. If you know an alternative way to make this visualization, let me know.

install.packages("ggsurvfit") install.packages("ggsurvfit", type = "source") library(remotes) remotes::install_github("ddsjoberg/ggsurvfit") library(devtools) devtools::install_github("pharmaverse/ggsurvfit") install.packages("ggsurvfit", type = "source") install.packages("ggsurvfit", repos = "https://cran.r-project.org")

Warning in install.packages : installation of package ‘ggsurvfit’ had non-zero exit status

The downloaded source packages are in ‘C:\Users\CLAHM\AppData\Local\Temp\RtmpYl9d8e\downloaded_packages’

library(ggsurvfit) #Error in library(ggsurvfit) : there is no package called ‘ggsurvfit’

In response to a former post about this issue, I also tried making a text file containing the following: PATH="${RTOOLS40_HOME}/usr/bin;${PATH}" in the location: C:\Users\YourUsername\

Sys.which("make")

"C:\rtools40\usr\bin\make.exe"

So the text file exists, but still, the package will not install nor load, with the same errors as above.

Here is all the console produces when I try to install:

Installing package into ‘C:/Users/CLAHM/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified) also installing the dependencies ‘cli’, ‘lifecycle’, ‘rlang’, ‘vctrs’, ‘ggplot2’

There are binary versions available but the source versions are later: binary source needs_compilation cli 3.2.0 3.6.2 TRUE lifecycle 1.0.1 1.0.4 FALSE rlang 1.0.2 1.1.3 TRUE vctrs 0.4.1 0.6.5 TRUE ggplot2 3.3.5 3.4.4 FALSE

installing the source packages ‘cli’, ‘lifecycle’, ‘rlang’, ‘vctrs’, ‘ggplot2’, ‘ggsurvfit’

trying URL 'https://cran.rstudio.com/src/contrib/cli_3.6.2.tar.gz' Content type 'application/x-gzip' length 569771 bytes (556 KB) downloaded 556 KB

trying URL 'https://cran.rstudio.com/src/contrib/lifecycle_1.0.4.tar.gz' Content type 'application/x-gzip' length 107656 bytes (105 KB) downloaded 105 KB

trying URL 'https://cran.rstudio.com/src/contrib/rlang_1.1.3.tar.gz' Content type 'application/x-gzip' length 763765 bytes (745 KB) downloaded 745 KB

trying URL 'https://cran.rstudio.com/src/contrib/vctrs_0.6.5.tar.gz' Content type 'application/x-gzip' length 969066 bytes (946 KB) downloaded 946 KB

trying URL 'https://cran.rstudio.com/src/contrib/ggplot2_3.4.4.tar.gz' Content type 'application/x-gzip' length 3159578 bytes (3.0 MB) downloaded 3.0 MB

trying URL 'https://cran.rstudio.com/src/contrib/ggsurvfit_1.0.0.tar.gz' Content type 'application/x-gzip' length 985358 bytes (962 KB) downloaded 962 KB

  • installing source package 'cli' ... ** package 'cli' successfully unpacked and MD5 sums checked ERROR: cannot remove earlier installation, is it in use?
  • removing 'C:/Users/CLAHM/Documents/R/win-library/4.0/cli'
  • restoring previous 'C:/Users/CLAHM/Documents/R/win-library/4.0/cli' Warning in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) : problem copying C:\Users\CLAHM\Documents\R\win-library\4.0\00LOCK-cli\cli\libs\x64\cli.dll to C:\Users\CLAHM\Documents\R\win-library\4.0\cli\libs\x64\cli.dll: Permission denied Warning in install.packages : installation of package ‘cli’ had non-zero exit status
  • installing source package 'rlang' ... ** package 'rlang' successfully unpacked and MD5 sums checked ERROR: cannot remove earlier installation, is it in use?
  • removing 'C:/Users/CLAHM/Documents/R/win-library/4.0/rlang'
  • restoring previous 'C:/Users/CLAHM/Documents/R/win-library/4.0/rlang' Warning in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) : problem copying C:\Users\CLAHM\Documents\R\win-library\4.0\00LOCK-rlang\rlang\libs\x64\rlang.dll to C:\Users\CLAHM\Documents\R\win-library\4.0\rlang\libs\x64\rlang.dll: Permission denied Warning in install.packages : installation of package ‘rlang’ had non-zero exit status
  • installing source package 'lifecycle' ... ** package 'lifecycle' successfully unpacked and MD5 sums checked ** using staged installation ** R ** inst ** byte-compile and prepare package for lazy loading Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : namespace 'rlang' 1.0.2 is being loaded, but >= 1.1.0 is required Calls: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace Execution halted ERROR: lazy loading failed for package 'lifecycle'
  • removing 'C:/Users/CLAHM/Documents/R/win-library/4.0/lifecycle'
  • restoring previous 'C:/Users/CLAHM/Documents/R/win-library/4.0/lifecycle' Warning in install.packages : installation of package ‘lifecycle’ had non-zero exit status
  • installing source package 'vctrs' ... ** package 'vctrs' successfully unpacked and MD5 sums checked ERROR: cannot remove earlier installation, is it in use?
  • removing 'C:/Users/CLAHM/Documents/R/win-library/4.0/vctrs'
  • restoring previous 'C:/Users/CLAHM/Documents/R/win-library/4.0/vctrs' Warning in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) : problem copying C:\Users\CLAHM\Documents\R\win-library\4.0\00LOCK-vctrs\vctrs\libs\x64\vctrs.dll to C:\Users\CLAHM\Documents\R\win-library\4.0\vctrs\libs\x64\vctrs.dll: Permission denied Warning in install.packages : installation of package ‘vctrs’ had non-zero exit status
  • installing source package 'ggplot2' ... ** package 'ggplot2' successfully unpacked and MD5 sums checked ** using staged installation ** R ** data *** moving datasets to lazyload DB ** inst ** byte-compile and prepare package for lazy loading Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : namespace 'rlang' 1.0.2 is being loaded, but >= 1.1.0 is required Calls: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace Execution halted ERROR: lazy loading failed for package 'ggplot2'
  • removing 'C:/Users/CLAHM/Documents/R/win-library/4.0/ggplot2'
  • restoring previous 'C:/Users/CLAHM/Documents/R/win-library/4.0/ggplot2' Warning in install.packages : installation of package ‘ggplot2’ had non-zero exit status
  • installing source package 'ggsurvfit' ... ** package 'ggsurvfit' successfully unpacked and MD5 sums checked ** using staged installation ** R ** data *** moving datasets to lazyload DB ** inst ** byte-compile and prepare package for lazy loading Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : namespace 'ggplot2' 3.3.6 is being loaded, but >= 3.4.0 is required Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace Execution halted ERROR: lazy loading failed for package 'ggsurvfit'
  • removing 'C:/Users/CLAHM/Documents/R/win-library/4.0/ggsurvfit' Warning in install.packages : installation of package ‘ggsurvfit’ had non-zero exit status

The downloaded source packages are in ‘C:\Users\CLAHM\AppData\Local\Temp\RtmpwXs30L\downloaded_packages’

0

There are 0 answers