R:无法在MacOsX上更新程序包

R:无法在MacOsX上更新程序包,r,macos,R,Macos,当我尝试在Mac OS X上更新R软件包时(作为一个具有管理员权限的普通用户,即/Library/Frameworks/R.framework/Versions/3.0/Resources是可写的),我得到了以下信息: > update.packages(instlib = .libPaths()[1], checkBuilt=TRUE, ask=FALSE) Warning: package 'foreign' in library '/Library/Frameworks/R.fram

当我尝试在Mac OS X上更新
R
软件包时(作为一个具有管理员权限的普通用户,即
/Library/Frameworks/R.framework/Versions/3.0/Resources
是可写的),我得到了以下信息:

> update.packages(instlib = .libPaths()[1], checkBuilt=TRUE, ask=FALSE)
Warning: package 'foreign' in library '/Library/Frameworks/R.framework/Versions/3.0/Resources/library' will not be updated
Warning: package 'lattice' in library '/Library/Frameworks/R.framework/Versions/3.0/Resources/library' will not be updated
Warning: package 'Matrix' in library '/Library/Frameworks/R.framework/Versions/3.0/Resources/library' will not be updated
Warning: package 'mgcv' in library '/Library/Frameworks/R.framework/Versions/3.0/Resources/library' will not be updated
Warning: package 'plotrix' in library '/Library/Frameworks/R.framework/Versions/3.0/Resources/library' will not be updated
trying URL 'http://lib.stat.cmu.edu/R/CRAN/bin/macosx/contrib/3.0/Hmisc_3.13-0.tgz'
Content type 'application/x-gzip' length 1514975 bytes (1.4 Mb)
opened URL
==============================================
downloaded 1.3 Mb

trying URL 'http://lib.stat.cmu.edu/R/CRAN/bin/macosx/contrib/3.0/Matrix_1.1-1.1.tgz'
Content type 'application/x-gzip' length 3450203 bytes (3.3 Mb)
opened URL
==================================================
downloaded 3.3 Mb

trying URL 'http://lib.stat.cmu.edu/R/CRAN/bin/macosx/contrib/3.0/nleqslv_2.1.tgz'
Content type 'application/x-gzip' length 89297 bytes (87 Kb)
opened URL
==================================================
downloaded 87 Kb

trying URL 'http://lib.stat.cmu.edu/R/CRAN/bin/macosx/contrib/3.0/plotrix_3.5-2.tgz'
Content type 'application/x-gzip' length 624295 bytes (609 Kb)
opened URL
========
downloaded 108 Kb

trying URL 'http://lib.stat.cmu.edu/R/CRAN/bin/macosx/contrib/3.0/nlme_3.1-113.tgz'
Content type 'application/x-gzip' length 2132159 bytes (2.0 Mb)
opened URL
==========
downloaded 457 Kb

trying URL 'http://lib.stat.cmu.edu/R/CRAN/bin/macosx/contrib/3.0/rpart_4.1-4.tgz'
Content type 'application/x-gzip' length 890223 bytes (869 Kb)
opened URL
==================================================
downloaded 869 Kb

Hmisc/help/Hmisc.rdb: (Empty error message)
tar: Error exit delayed from previous errors.
plotrix/R/plotrix.rdb: (Empty error message)
tar: Error exit delayed from previous errors.
Error: file ‘/var/tmp/RtmpY8MhsZ/downloaded_packages/plotrix_3.5-2.tgz’ is not an OS X binary package
In addition: Warning messages:
1: In download.file(url, destfile, method, mode = "wb", ...) :
  downloaded length 1402861 != reported length 1514975
Calls: update.packages -> install.packages -> .install.macbinary -> download.packages -> try -> tryCatch -> tryCatchList -> tryCatchOne -> doTryCatch -> download.file
2: In download.file(url, destfile, method, mode = "wb", ...) :
  downloaded length 111247 != reported length 624295
Calls: update.packages -> install.packages -> .install.macbinary -> download.packages -> try -> tryCatch -> tryCatchList -> tryCatchOne -> doTryCatch -> download.file
3: In download.file(url, destfile, method, mode = "wb", ...) :
  downloaded length 468901 != reported length 2132159
Calls: update.packages -> install.packages -> .install.macbinary -> download.packages -> try -> tryCatch -> tryCatchList -> tryCatchOne -> doTryCatch -> download.file
4: 'tar' returned non-zero exit code 1 
5: 'tar' returned non-zero exit code 1 
Execution halted
/var/tmp/RtmpY8MhsZ/downloaded_packages/
中的
.tgz
文件是有效的tar/gzip文件:

$ tar tvfz /var/tmp/RtmpY8MhsZ/downloaded_packages/Matrix_1.1-1.1.tgz 
drwxrwxr-x  0 root   admin       0 Jan  1 01:47 Matrix/
-rw-rw-r--  0 root   admin    2433 Jan  1 01:45 Matrix/Copyrights
drwxrwxr-x  0 root   admin       0 Jan  1 01:45 Matrix/data/
-rw-rw-r--  0 root   admin    1253 Jan  1 01:45 Matrix/DESCRIPTION
drwxrwxr-x  0 root   admin       0 Jan  1 01:47 Matrix/doc/
-rw-rw-r--  0 root   admin   72521 Jan  1 01:45 Matrix/Doxyfile
drwxrwxr-x  0 root   admin       0 Jan  1 01:45 Matrix/external/
drwxrwxr-x  0 root   admin       0 Jan  1 01:47 Matrix/help/
drwxrwxr-x  0 root   admin       0 Jan  1 01:47 Matrix/html/
drwxrwxr-x  0 root   admin       0 Jan  1 01:45 Matrix/include/
.....
我做错什么了吗?

因为,解决方案是设置
TAR
环境变量:

TAR=/usr/bin/tar R CMD ...

您是否以root用户身份运行R?@hd1:no,普通用户,具有管理员权限;请参阅编辑。警告可能只是表示您已经拥有这些软件包的最新版本。请尝试
library(lattice)
然后
sessionInfo()
查看加载的版本,然后与CRAN上的可用版本进行比较。@BryanHanson:这是一个错误,不是警告。请查看R-SIG-Mac邮件列表中的此消息