简体   繁体   English

在 R Studio 上安装 R 包的问题

[英]Issue with installing R package on R studio

I work on Rstudio and my version() result is:我在 Rstudio 上工作,我的 version() 结果是:

> version
               _                           
platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
status                                     
major          3                           
minor          3.1                         
year           2016                        
month          06                          
day            21                          
svn rev        70800                       
language       R                           
version.string R version 3.3.1 (2016-06-21)
nickname       Bug in Your Hair

I downloaded the latest version this morning from the web to have the last update.我今天早上从网上下载了最新版本以进行最后一次更新。 On this, I can not install the package "raster":在这一点上,我无法安装包“光栅”:

> install.packages('raster')
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/florent/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘raster’ is not available (for R version 3.3.1)

I have checked many help online but I can´t find the solution.我在网上查了很多帮助,但找不到解决方案。 I did an update of R (to 4.0.2) with which this raster package is working.我更新了 R(到 4.0.2),这个光栅包正在工作。

Anyone has a solution for this?任何人都有解决方案? It begins to be tricky...它开始变得棘手......

Thanks!谢谢!

It appears that you updated RStudio , but not R .您似乎更新了RStudio ,但没有更新R RStudio is a program to make it easier to use R. So what you need to do is install the current version of R . RStudio 是一个让 R 使用更容易的程序。所以你需要做的是安装R的当前版本。 As you can see from your version , you are using a version from 2016. That is ancient in the R world.从您的version可以看出,您使用的是 2016 年的版本。这在 R 世界中很古老。

In RStudio you can look under Tools / Global Options / General / R version and perhaps change the R version if multiple versions are available.在 RStudio 中,您可以查看工具/全局选项/常规/R 版本,如果有多个版本可用,可能会更改R版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM