“无法加载包‘mgcv’"仅在 RStudio 中 [英] "package ‘mgcv’ could not be loaded" only in RStudio

查看:47
本文介绍了“无法加载包‘mgcv’"仅在 RStudio 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在 RStudio 中加载包TSA"时出现此错误:

I'm getting this error when trying to load the package "TSA" in RStudio:

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

我尝试重新安装 mgcv 和 TSA,但没有帮助.但是,当我从 R 命令行加载 TSA 时,它可以正常工作.

I tried reinstalling mgcv and TSA, but it didn't help. However, when I load TSA from the R command line, it works without problem.

我该如何解决这个问题?

How can I fix this issue?

R 版本 3.0.2 (2013-09-25)

R version 3.0.2 (2013-09-25)

RStudio 0.97.551,64 位.

RStudio 0.97.551, 64 bits.

更新:

我在 RStudio 的 32 位安装中测试了这个问题,它工作得很好.我不确定真正的罪魁祸首是什么.

I tested this issue in a 32 bit installation of RStudio and it worked flawlessly. I'm not sure what is the real culprit here.

推荐答案

终于搞定了.

我不得不通过 sudo apt-get --purge remove rstudio 删除 rstudio 并删除 ~/.config/RStudio.奇怪的是,这并没有删除所有内容,因为当我重新安装 RStudio 时,一些打开的文档仍然存在.然而,它做到了.

I had to remove rstudio via sudo apt-get --purge remove rstudio and remove ~/.config/RStudio. Oddly enough, this didn't remove everything because some opened documents remained when I reinstalled RStudio. However, it did the trick.

> library(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
This is mgcv 1.7-26. For overview type 'help("mgcv-package")'.
Loading required package: tseries

    ‘tseries’ version: 0.10-32

    ‘tseries’ is a package for time series analysis and
    computational finance.

    See ‘library(help="tseries")’ for details.


Attaching package: ‘TSA’

The following objects are masked from ‘package:stats’:

    acf, arima

The following object is masked from ‘package:utils’:

    tar

更新:

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

Unfortunately, every time I restart RStudio, I get the same error as before. So this is only a temporary solution. Suggestions?

更新 2:

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

Ultimately, this issue seems to have been resolved. I removed ~/.rstudio-desktop/monitored/user-settings/ and the problem immediately was solved without requiring reinstalling RStudio.

这篇关于“无法加载包‘mgcv’"仅在 RStudio 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆