# error in installing R packages

Hello,

Could anyone tell me how to install R packages in Sage? I fail it as follows:

```
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.7.4
BuildVersion: 11E53
$ hdiutil mount /Users/me/Downloads/sage-5.2-OSX-64bit-10.6-x86_64-Darwin.dmg
$ cp -R -P /Volumes/sage-5.2-OSX-64bit-10.6-x86_64-Darwin/sage /Applications
$ open /Applications/sage/sage
:
:
$
$ sage
----------------------------------------------------------------------
| Sage Version 5.2, Release Date: 2012-07-25 |
| Type "notebook()" for the browser-based notebook interface. |
| Type "help()" for help. |
----------------------------------------------------------------------
sage:
sage: quit
Exiting Sage (CPU time 0m0.05s, Wall time 0m6.00s).
$
$ sage -R
R version 2.14.0 (2011-10-31)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-apple-darwin10.8.0 (64-bit)
:
:
> install.packages('coda')
:
:
trying URL 'http://cran.ism.ac.jp/src/contrib/coda_0.15-2.tar.gz'
Content type 'application/x-gzip' length 73937 bytes (72 Kb)
opened URL
==================================================
downloaded 72 Kb
* installing *source* package coda ...
** package 'coda' successfully unpacked and MD5 sums checked
** R
** data
** inst
** preparing package for lazy loading
Error in if (file.info(codeFile)["size"] == file.info(loaderFile)["size"]) warning("package seems to be using lazy loading already") else { :
missing value where TRUE/FALSE needed
ERROR: lazy loading failed for package coda
* removing /Applications/sage/local/lib/R/library/coda
The downloaded packages are in
/private/var/folders/ch/p_433hf96vq2qm72w1gg3mmc0000gn/T/RtmpVPLwTU/downloaded_packages
Warning message:
In install.packages("coda") :
installation of package 'coda' had non-zero exit status
>
> q()
Save workspace image? [y/n/c]: n
$
$ sage -f r
Calling sage-spkg on 'r'
r-2.14.0.p3
====================================================
Extracting package /Applications/sage/spkg/standard/r-2.14.0.p3.spkg
-rw-r--r--@ 1 kkondo admin 107 7 27 23:26 /Applications/sage/spkg/standard/r-2.14.0.p3.spkg
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
Error: failed to extract /Applications/sage/spkg/standard/r-2.14.0.p3.spkg
$
```