无法在R Studio中安装软件包-无法转换为本地编码

时间:2020-09-15 16:38:49

标签: r package

我无法从R Studio安装该软件包。不知道“无法转换...到本机编码”是什么意思。 有人知道如何解决吗?

Warning in install.packages :
  unable to translate 'C:/Users/molly/OneDrive/<U+6587><U+6863>/R/win-library/4.0' to native encoding
trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.0/mvtnorm_1.1-1.zip'
Content type 'application/zip' length 268839 bytes (262 KB)
downloaded 262 KB

package ‘mvtnorm’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\molly\AppData\Local\Temp\RtmpyMACBs\downloaded_packages
Warning in install.packages :
  unable to translate 'C:/Users/molly/OneDrive/<U+6587><U+6863>/R/win-library/4.0' to native encoding
Warning messages:
1: In base::list.dirs(.libPaths(), full.names = FALSE, recursive = FALSE) :
  unable to translate 'C:/Users/molly/OneDrive/<U+6587><U+6863>/R/win-library/4.0' to native encoding
2: In list.files(.rs.uniqueLibraryPaths(), full.names = TRUE) :
  unable to translate 'C:/Users/molly/OneDrive/<U+6587><U+6863>/R/win-library/4.0' to native encoding
3: In list.files(.rs.uniqueLibraryPaths(), full.names = TRUE) :
  unable to translate 'C:/Users/molly/OneDrive/<U+6587><U+6863>/R/win-library/4.0' to native encoding

1 个答案:

答案 0 :(得分:1)

如果不能编码,

您需要:


  1. 为以后的包创建文件夹
  2. 导航到 C:\Program Files\R\R-4.0.4\etc
  3. 在那里创建一个空文件“.site
  4. 将空文件“ ”重命名为“Renviron”(这样你会得到 Renviron.site
  5. 写入文件:"R_LIBS_USER=c:/Name_of_ur_folder"

享受