当试图在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我试着重新安装mgcv和TSA,但是没有帮助。但是,当我从R命令行加载TSA时,它没有问题。
我怎样才能解决这个问题?
R版本3.0.2 (2013-09-25)
RStudio 0.97.551,64位。
更新
我在32位的RStudio安装中测试了这个问题,它运行得完美无缺。我不知道什么是真正的罪魁祸首。
发布于 2013-09-30 17:35:32
终于起作用了。
我不得不通过sudo apt-get --purge remove rstudio删除rstudio,并删除~/.config/RStudio。奇怪的是,这并没有删除所有的东西,因为当我重新安装RStudio时,一些打开的文档仍然存在。然而,它起了作用。
> 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时,都会得到与以前相同的错误。因此,这只是一个暂时的解决办法。有什么建议吗?
更新2
最终,这一问题似乎已经得到解决。我删除了~/.rstudio-desktop/monitored/user-settings/并立即解决了问题,而不需要重新安装RStudio。
发布于 2014-11-23 08:04:16
在RStudio中,只需调整右侧的大小以增加窗口的宽度。现在再试一次library(mgcv),它就能工作了!
发布于 2014-10-27 16:39:05
为了供在Windows 7下遇到类似问题的人参考,我在forecast包上也遇到了同样的问题--有一天,它不会在RStudio中加载(在R中工作得很好)。必须完全卸载R和RStudio,确保删除C:\Program Files\R和C:\Users\[username]\AppData\Local\RStudio-Desktop并重新安装,然后才能再次工作。如果我只是删除了RStudio的内容并试图保存R文件,那就不起作用了。
https://stackoverflow.com/questions/19086111
复制相似问题