我在使用ggplot2
和survminer
套餐时出现以下错误。
我真的不知道为什么会出现警告。
> install.packages(c("survival", "survminer", "ggplot2"))
Installing packages into ‘C:/Users/xu081/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://mirrors.tongji.edu.cn/CRAN/bin/windows/contrib/3.4/survival_2.42-3.zip'
Content type 'application/zip' length 4584781 bytes (4.4 MB)
downloaded 4.4 MB
trying URL 'https://mirrors.tongji.edu.cn/CRAN/bin/windows/contrib/3.4/survminer_0.4.2.zip'
Content type 'application/zip' length 2849057 bytes (2.7 MB)
downloaded 2.7 MB
trying URL 'https://mirrors.tongji.edu.cn/CRAN/bin/windows/contrib/3.4/ggplot2_2.2.1.zip'
Content type 'application/zip' length 2784778 bytes (2.7 MB)
downloaded 2.7 MB
package ‘survival’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘survival’
package ‘survminer’ successfully unpacked and MD5 sums checked
package ‘ggplot2’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\xu081\AppData\Local\Temp\RtmpuOtZaF\downloaded_packages
> library(survival)
> library(ggplot2)
Error in UseMethod("conditionCall") :
no applicable method for 'conditionCall' applied to an object of class "character"
> library(survminer)
载入需要的程辑包:ggplot2
Error in UseMethod("conditionCall") :
no applicable method for 'conditionCall' applied to an object of class "character"
> install.packages("devtools")
Installing package into ‘C:/Users/xu081/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
trying URL'https://mirrors.tongji.edu.cn/CRAN/bin/windows/contrib/3.4/devtools_1.13.5.zip'
Content type 'application/zip' length 443954 bytes (433 KB)
downloaded 433 KB
package ‘devtools’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\xu081\AppData\Local\Temp\Rtmpa62LXv\downloaded_packages
> library(devtools)
> devtools::install_github("tidyverse/ggplot2")
Downloading GitHub repo tidyverse/ggplot2@master
from URL https://api.github.com/repos/tidyverse/ggplot2/zipball/master
Installing ggplot2
"C:/PROGRA~1/R/R-34~1.4/bin/x64/R" --no-site-file --no-environ --no-save no-restore --quiet CMD INSTALL \
"C:/Users/xu081/AppData/Local/Temp/Rtmpa62LXv/devtools1dac50bf8ef/tidyverse-ggplot2-4463da6" \
--library="C:/Users/xu081/Documents/R/win-library/3.4" --install-tests
* installing *source* package 'ggplot2' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** tests
** preparing package for lazy loading
Error in UseMethod("conditionCall") :
"conditionCall"没有适用于"character"目标对象的方法
* removing 'C:/Users/xu081/Documents/R/win-library/3.4/ggplot2'
* restoring previous 'C:/Users/xu081/Documents/R/win-library/3.4/ggplot2'
In R CMD INSTALL
Error in UseMethod("conditionMessage") :
no applicable method for 'conditionMessage' applied to an object of class
"character"
我非常感谢你的回答。