weixin_43199528 2019-04-19 23:38
浏览 2498

在旧版本R中利用代码升级R后,安装包路径改变无法识别。

1.因为在Rstudio想用的安装包总提示是在3.5.3中创建的,因此希望更新R,最后利用三行代码在R中更新至新版本。
2.返回rstudio后发现再运行之前下载的Hmisc包无反应,于是重新安装该包,结果显示安装在了另一个路径里,更新之前还能正常下载和调用,但是现在直接报错说找不到。
3.所以想求助大家(1)为何更新后会有如此变化,应该如何恢复或者优化。(2)为了更方便的使用Rstudio,应该将r包放在哪个路径中。
谢谢!
下面为更新后的在Rstudio中的运行代码,恳请大神指教!
R version 3.5.3 (2019-03-11) -- "Great Truth"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

Warning: namespace ‘DOSE’ is not available and has been replaced
by .GlobalEnv when processing object ‘.DOSEEnv’
Warning: namespace ‘clusterProfiler’ is not available and has been replaced
by .GlobalEnv when processing object ‘.GOTERM_Env’
[Workspace loaded from ~/.RData]

installed.packages(hmisc)
Error in installed.packages(hmisc) : object 'hmisc' not found
data(package = .packages(all.available = TRUE))
Warning messages:
1: In data(package = .packages(all.available = TRUE)) :
數據機从程序包'base'移到了程序包'datasets'
2: In data(package = .packages(all.available = TRUE)) :
數據機从程序包'stats'移到了程序包'datasets'
install.packages("installr")
Installing package into ‘C:/Users/zhangying/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'https://mirrors.ustc.edu.cn/CRAN/bin/windows/contrib/3.5/installr_0.21.0.zip'
Content type 'application/zip' length 336193 bytes (328 KB)
downloaded 328 KB

package ‘installr’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\zhangying\AppData\Local\Temp\RtmpMtame0\downloaded_packages

library(installr)
载入需要的程辑包:stringr
Error: package or namespace load failed for ‘stringr’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
不存在叫‘stringi’这个名字的程辑包
Error: 无法载入程辑包‘stringr’

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
    • ¥50 成都蓉城足球俱乐部小程序抢票
    • ¥15 yolov7训练自己的数据集
    • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
    • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
    • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)