手动安装R包时会出现错误

发布于 2025-02-12 18:42:25 字数 1318 浏览 0 评论 0原文

我是R的新手。我的工作笔记本电脑有各种各样的问题。我似乎无法通过rstudio安装R,因此我决定尝试像在Python一样尝试使用文件夹手动安装软件包。这是我遵循的步骤:

我在rstudio中运行.libpath()以确定软件包的安装位置。它返回以下内容:

[1] "\\\\lbsjsh-mp-ns1/user$/H/R/win-library/3.5"                                                                 
[2] "C:/ProgramData/App-V/9053-3BB61A6E2F38/Root/R/R-3.5.0/library"

我注意到软件包在第一路径中。然后,我导航到以下网站:

project.org/web/packages/ggplot2/index.html

我下载:r-devel: ggplot2_3.3.6. zip

i然后将文件夹提取到以下目录中:“ \\ lbsjsh-mp-ns1/user $/h/r/r/win-library/3.5”

当我运行library(ggplot2)在rstudio中,我会收到以下错误:

Error: package or namespace load failed for ‘ggplot2’ in rbind(info, getNamespaceInfo(env, "S3methods")):
 number of columns of matrices must match (see arg 2)
In addition: Warning message:
package ‘ggplot2’ was built under R version 4.3.0 

我什至尝试通过在rstudio中键入以下zip文件来安装它:

install.packages("C:\Users\H\Downloads\ggplot2_3.3.6.zip", repos = NULL, type="binary")

但是我会收到以下错误:

Error: '\U' used without hex digits in character string starting ""C:\U"

有人知道为什么这可以 是?。任何帮助将不胜感激。

I am new to R. My work laptop has all sorts of problems. I can't seem to install R via RStudio so I decided to try to install the packages manually using the folders just as I do in Python. Here are the steps I followed:

I ran.libPaths() in RStudio to determine where the packages are installed. It returned the following:

[1] "\\\\lbsjsh-mp-ns1/user$/H/R/win-library/3.5"                                                                 
[2] "C:/ProgramData/App-V/9053-3BB61A6E2F38/Root/R/R-3.5.0/library"

I noticed that packages are in the 1st path. I then navigated to the following site:

https://cran.r-project.org/web/packages/ggplot2/index.html

I downloaded: r-devel: ggplot2_3.3.6.zip

I then extracted the folder into the following directory: "\\lbsjsh-mp-ns1/user$/H/R/win-library/3.5"

When I run library(ggplot2)in RStudio I get the following error:

Error: package or namespace load failed for ‘ggplot2’ in rbind(info, getNamespaceInfo(env, "S3methods")):
 number of columns of matrices must match (see arg 2)
In addition: Warning message:
package ‘ggplot2’ was built under R version 4.3.0 

I even tried to install it using the zip file by typing the following in RStudio:

install.packages("C:\Users\H\Downloads\ggplot2_3.3.6.zip", repos = NULL, type="binary")

But I get the following error:

Error: '\U' used without hex digits in character string starting ""C:\U"

Does anyone know why this could be?. Any help would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

dawn曙光 2025-02-19 18:42:25
  1. https://cran.r-project.org/
  2. 打开rgui
  3. packages->从本地文件中安装软件包,
  4. 导航到所需的.zip文件,然后单击“ OK”
  5. 等待一小段时间,而软件包安装时
  1. Download the .zip file for the package from https://cran.r-project.org/
  2. Open RGui
  3. Packages -> Install package(s) from local file(s)
  4. Navigate to the desired .zip file and click OK
  5. Wait a short while whilst the package installs
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文