欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Rstudio中安裝package出現(xiàn)的問題及解決

 更新時間:2021年04月02日 10:55:57   作者:LiuHuan_study  
這篇文章主要介紹了Rstudio中安裝package出現(xiàn)的問題及解決方案,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧

Rstudio中安裝package問題

一、 install.packages('REmap')無法安裝package:錯誤:“無法與服務器建立連接”

解決方式:切換下載的鏡像

方法一:在Rstudio菜單欄:tools-global options-packages中切換下載的鏡像

方法二:修改文件,在安裝文件夾中找到Rprofile.site文件,我的路徑是D:\Program Files\R\R-3.4.1\etc,用記事本打開,在里面添加語句:

# set a CRAN mirror
local({r <- getOption(“repos”)
r[“CRAN”] <- “http://mirrors.tuna.tsinghua.edu.cn/CRAN/”
options(repos=r)}

二、手動安裝package

在網站:https://mirrors.tuna.tsinghua.edu.cn/CRAN/下載好需要的package

1.在R studio下,選擇packages

2.選擇Install

3.Install from欄選擇Package Archive File(.zip;.tar.gz)

4.Package archive欄點擊Browser,選擇剛才下載的文件

5.點擊Install,進行安裝

致此,手動安裝R包完成。安裝提示如下

推薦第一種安裝方式:因為第一種安裝方式會自動安裝依賴的包,而第二種方式,除了下載你想安裝的包還要下載所有依賴的包,這就有一定的難度了。

補充:Rstudio安裝packages時報錯,原因可能是這樣

最近接觸R語言,安裝好Rstudio后,需要安裝R的第三方包mirt。

執(zhí)行步驟如下:

正當滿心歡喜地期待包的安裝時,結果出現(xiàn)了下面的情況:

install.packages("mirt")
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/likailei/Documents/R/win-library/3.6'
(as ‘lib' is unspecified)
Warning in install.packages :
 unable to access index for repository https://cran.rstudio.com/src/contrib:
 cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'
Warning in install.packages :
 package ‘mirt' is not available (for R version 3.6.0)
Warning in install.packages :
 unable to access index for repository https://cran.rstudio.com/bin/windows/contrib/3.6:
 cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/PACKAGES'

什么鬼?!

此處省略5000字的辛苦排錯的歷程描述,直接貼上解決方案:

Rstudio默認使用的國外鏡像源,國內無法正常訪問。

Rstudio設置如下

Tools>global options>packages

更改鏡像源后,重新執(zhí)行安裝操作。

install.packages("mirt")
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/likailei/Documents/R/win-library/3.6'
(as ‘lib' is unspecified)
also installing the dependencies ‘permute', ‘GPArotation', ‘Rcpp', ‘vegan', ‘Deriv', ‘dcurver', ‘RcppArmadillo'

trying URL 'https://mirrors.#edu.cn/CRAN/bin/windows/contrib/3.6/permute_0.9-5.zip'
Content type 'application/zip' length 505181 bytes (493 KB)
downloaded 493 KB

trying URL 'https://mirrors.#edu.cn/CRAN/bin/windows/contrib/3.6/GPArotation_2014.11-1.zip'
Content type 'application/zip' length 162104 bytes (158 KB)
downloaded 158 KB

trying URL 'https://mirrors.#edu.cn/CRAN/bin/windows/contrib/3.6/Rcpp_1.0.1.zip'
Content type 'application/zip' length 4494896 bytes (4.3 MB)
downloaded 4.3 MB

trying URL 'https://mirrors.#edu.cn/CRAN/bin/windows/contrib/3.6/vegan_2.5-5.zip'
Content type 'application/zip' length 3861520 bytes (3.7 MB)
downloaded 3.7 MB

trying URL 'https://mirrors.#edu.cn/CRAN/bin/windows/contrib/3.6/Deriv_3.8.5.zip'
Content type 'application/zip' length 133828 bytes (130 KB)
downloaded 130 KB

trying URL 'https://mirrors.#edu.cn/CRAN/bin/windows/contrib/3.6/dcurver_0.9.1.zip'
Content type 'application/zip' length 639915 bytes (624 KB)
downloaded 624 KB

trying URL 'https://mirrors.#edu.cn/CRAN/bin/windows/contrib/3.6/RcppArmadillo_0.9.400.3.0.zip'
Content type 'application/zip' length 2276463 bytes (2.2 MB)
downloaded 2.2 MB

trying URL 'https://mirrors.#edu.cn/CRAN/bin/windows/contrib/3.6/mirt_1.30.zip'
Content type 'application/zip' length 2572772 bytes (2.5 MB)
downloaded 2.5 MB

package ‘permute' successfully unpacked and MD5 sums checked
package ‘GPArotation' successfully unpacked and MD5 sums checked
package ‘Rcpp' successfully unpacked and MD5 sums checked
package ‘vegan' successfully unpacked and MD5 sums checked
package ‘Deriv' successfully unpacked and MD5 sums checked
package ‘dcurver' successfully unpacked and MD5 sums checked
package ‘RcppArmadillo' successfully unpacked and MD5 sums checked
package ‘mirt' successfully unpacked and MD5 sums checked

完美?。?!

以上為個人經驗,希望能給大家一個參考,也希望大家多多支持腳本之家。如有錯誤或未考慮完全的地方,望不吝賜教。

相關文章

  • Rcpp入門R代碼提速方法過程

    Rcpp入門R代碼提速方法過程

    這篇文章主要為大家介紹了Rcpp入門如何讓R代碼更快的提速方法過程,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步
    2021-11-11
  • R語言數(shù)據(jù)可視化ggplot繪制置信區(qū)間與分組繪圖技巧

    R語言數(shù)據(jù)可視化ggplot繪制置信區(qū)間與分組繪圖技巧

    這篇文章主要為大家介紹了R語言數(shù)據(jù)可視化ggplot繪制置信區(qū)間與分組繪圖的技巧,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步
    2021-11-11
  • R語言學習之線圖的繪制詳解

    R語言學習之線圖的繪制詳解

    線圖是反映趨勢變化的一種方式,其輸入數(shù)據(jù)一般也是一個矩陣。本文將利用R語言繪制單線圖、多線圖以及橫軸文本線圖,感興趣的可以了解一下
    2022-03-03
  • 詳解R語言的24個高效操作技巧

    詳解R語言的24個高效操作技巧

    這篇文章主要為大家介紹了R語言的24個高效操作技巧詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2023-04-04
  • R語言ggplot2包之注釋方式

    R語言ggplot2包之注釋方式

    這篇文章主要介紹了R語言ggplot2包之注釋方式,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2021-04-04
  • R語言多元Logistic邏輯回歸應用實例

    R語言多元Logistic邏輯回歸應用實例

    這篇文章主要給大家介紹了關于R語言多元Logistic邏輯回歸應用的相關資料,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2021-03-03
  • Rstudio 修改工作路徑(三種方法總結)

    Rstudio 修改工作路徑(三種方法總結)

    這篇文章主要介紹了Rstudio 修改工作路徑(三種方法總結),具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2021-04-04
  • R語言數(shù)據(jù)讀取以及數(shù)據(jù)保存方式

    R語言數(shù)據(jù)讀取以及數(shù)據(jù)保存方式

    這篇文章主要介紹了R語言數(shù)據(jù)讀取以及數(shù)據(jù)保存方式,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2021-04-04
  • R語言實現(xiàn)對數(shù)據(jù)框按某一列分組求組內平均值

    R語言實現(xiàn)對數(shù)據(jù)框按某一列分組求組內平均值

    這篇文章主要介紹了R語言實現(xiàn)對數(shù)據(jù)框按某一列分組求組內平均值,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2021-03-03
  • R語言時間序列知識點總結

    R語言時間序列知識點總結

    在本篇文章里小編給大家整理了一篇關于R語言時間序列知識點總結內容,有興趣的朋友們可以學習下。
    2021-03-03

最新評論