【问题标题】:R install pacakages error (escape in character string) in Library PathR在库路径中安装包错误(字符串中的转义)
【发布时间】:2022-01-26 02:37:48
【问题描述】:

我已尝试编辑 .libpaths() 的输出并对其进行更改,但我仍然收到以下错误,

PS C:\Users\Jesus> radian
Error: '\D' is an unrecognized escape in character string starting "'D:\D"
R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Platform: x86_64-w64-mingw32 (64-bit)

如果您注意到'\D' is an unrecognized escape in character string starting "'D:\D" 即使在我切换到弧度时也很明显。

r$> .libPaths()
[1] "D:/Documents/R/win-library/4.1"     "C:/Program Files/R/R-4.1.2/library"
r$> remotes::install_github("ManuelHentschel/vscDebugger")
Downloading GitHub repo ManuelHentschel/vscDebugger@HEAD
v  checking for file 'C:\Users\Jesus\AppData\Local\Temp\RtmpSaUPCL\remotes27fc9487e46\ManuelHentschel-vscDebugger-ce8f248/DESCRIPTION'
-  preparing 'vscDebugger': (359ms)
v  checking DESCRIPTION meta-information ... 
-  cleaning src
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
   Omitted 'LazyData' from DESCRIPTION
-  building 'vscDebugger_0.4.7.tar.gz'
   
Installing package into 'D:/Documents/R/win-library/4.1'
(as 'lib' is unspecified)
Error: '\D' is an unrecognized escape in character string starting "'D:\D"
Execution halted
Warning message:
In i.p(...) :
  installation of package 'C:/Users/Jesus/AppData/Local/Temp/RtmpSaUPCL/file27fc7270a15/vscDebugger_0.4.7.tar.gz' had non-zero exit status

我收到此错误Error: '\D' is an unrecognized escape in character string starting "'D:\D" 我认为它只发生在我尝试安装的特定软件包上。

如果有人知道如何解决这个问题,那么我可以在 VSCode 上进行 R 调试。

谢谢。

【问题讨论】:

    标签: r debugging visual-studio-code visual-studio-debugging


    【解决方案1】:

    我发现我的.Rprofile 有问题 查看其他论坛,删除您的 .Rdata 文件似乎也有帮助。

    它生成为

    # LanguageServer Setup Start (do not change this chunk)
    # to remove this, run languageserversetup::remove_from_rprofile
    if (requireNamespace('languageserversetup', quietly = TRUE)) {
      options(langserver_library = 'D:\Documents/languageserver-library')
      languageserversetup::languageserver_startup()
      unloadNamespace('languageserversetup')
    }
    # LanguageServer Setup End
    

    修复方法是将'D:\Documents/languageserver-library' 中的\ 更改为/

    'D:/Documents/languageserver-library'

    干杯

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-01-24
      • 1970-01-01
      • 2012-12-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-24
      相关资源
      最近更新 更多