"仅在RStudio中无法加载"封装'mgcv'

Rob*_*ith 7 r rstudio

我在尝试加载RStudio中的"TSA"包时遇到此错误:

Loading required package: leaps
Loading required package: locfit
locfit 1.5-9.1   2013-03-22
Loading required package: mgcv
Loading required package: nlme
Error : .onAttach failed in attachNamespace() for 'mgcv', details:
  call: formatDL(nm, txt, indent = max(nchar(nm, "w")) + 3)
  error: incorrect values of 'indent' and 'width'
Error: package ‘mgcv’ could not be loaded
Run Code Online (Sandbox Code Playgroud)

我尝试重新安装mgcv和TSA,但它没有帮助.但是,当我从R命令行加载TSA时,它没有问题.

我该如何解决这个问题?

R版本3.0.2(2013-09-25)

RStudio 0.97.551,64位.

更新:

我在一个32位的RStudio安装中测试了这个问题,它运行得很完美.我不确定这里真正的罪魁祸首是什么.

Che*_*eng 20

在RStudio中,只需调整右侧的大小即可增加窗口的宽度.现在再试library(mgcv)一次,它的确有效!

  • 我无法相信这是有效的,但确实如此. (2认同)

Rob*_*ith 0

终于成功了。

\n\n

我必须删除 rstudio viasudo apt-get --purge remove rstudio并删除~/.config/RStudio. 奇怪的是,这并没有删除所有内容,因为当我重新安装 RStudio 时,一些打开的文档仍然存在。然而,它成功了。

\n\n
> library(TSA)\nLoading required package: leaps\nLoading required package: locfit\nlocfit 1.5-9.1   2013-03-22\nLoading required package: mgcv\nLoading required package: nlme\nThis is mgcv 1.7-26. For overview type \'help("mgcv-package")\'.\nLoading required package: tseries\n\n    \xe2\x80\x98tseries\xe2\x80\x99 version: 0.10-32\n\n    \xe2\x80\x98tseries\xe2\x80\x99 is a package for time series analysis and\n    computational finance.\n\n    See \xe2\x80\x98library(help="tseries")\xe2\x80\x99 for details.\n\n\nAttaching package: \xe2\x80\x98TSA\xe2\x80\x99\n\nThe following objects are masked from \xe2\x80\x98package:stats\xe2\x80\x99:\n\n    acf, arima\n\nThe following object is masked from \xe2\x80\x98package:utils\xe2\x80\x99:\n\n    tar\n
Run Code Online (Sandbox Code Playgroud)\n\n

更新

\n\n

不幸的是,每次我重新启动 RStudio 时,都会遇到与以前相同的错误。所以这只是一个临时解决方案。建议?

\n\n

更新2

\n\n

最终,这个问题似乎已经得到解决。我删除了~/.rstudio-desktop/monitored/user-settings/,问题立即得到解决,无需重新安装 RStudio。

\n