Skip to content

Can not install fCalendar package under R 2.6.2

4 messages · Yan Wang, Brian Ripley, Dirk Eddelbuettel

#
Dear R helper:
When I was trying to install the fCalendar package, R report the 
following error and then my installation failed:

* Installing *source* package 'fCalendar' ...
** R
** inst
** preparing package for lazy loading
Loading required package: MASS
Loading required package: fEcofin
Loading required package: fUtilities
Loading required package: RUnit

  RUnit 0.4.17 loaded.
Loading required package: spatial
Loading required package: tcltk
Loading Tcl/Tk interface ... done
Loading required package: zoo
Error in .Internal(putenv(x)) : no internal function "putenv"
Calls: <Anonymous> ... sys.source -> eval -> eval -> .currentYear -> 
Sys.setenv
Execution halted
ERROR: lazy loading failed for package 'fCalendar'
** Removing '/usr/local/lib/R/site-library/fCalendar'

by the way, my system is Ubuntu 7.04,
platform       i486-pc-linux-gnu
arch           i486
os             linux-gnu
system         i486, linux-gnu

I tried to look for  putenv myself, R reported that it is a deprecated 
function in "base" package, I loaded the "base" package and still end up 
with the same Error report.

Pls do help me.

Yan Wang
Georgia Institute of Technology
School of Industrial and Systems Engineering

E-mail address:   ywang67 at isye.gatech.edu
#
I suspect you have a rather old version of the fCalendar package (or 
possibly of one of the packages it loads).  The current version is 262.73 
and does not use putenv or Sys.putenv.

(Packages really should not be using global system settings but the 
current version does
function ()
{
     TZ <- Sys.getenv("TZ")
     if (TZ[[1]] != "GMT") {
         Sys.setenv(TZ = "GMT")
         on.exit(Sys.setenv(TZ = TZ))
     }
     as.POSIXlt(Sys.time())$year + 1900
}

whereas as.POSIXlt has a 'tz' argument.  I also don't see the point of 
recording the current year *when the package is installed*: a comment 
says this is done in '.Firstlib' but it is not done in .First.lib.)
On Sat, 22 Mar 2008, Yan Wang wrote:

            
It is Sys.putenv that is deprecated.  The internal function putenv went in 
R 2.5.0.

  
    
#
Dear Prof Brian Ripley and other R guru:
   Very happy to receive your help. Actually what I use is 262.73. In 
detail, what I have been doing is the following:
   First I have a not-up-to-dated R 2.4.0 under ubuntu 7.04, then I tried 
to install fCalendar(what I really want to use is fGarch, but it depends 
on fCalendar), I use install.packages to do it, so the fCalendar packages 
I had downloaded is up to dated 262.73(I also have checked it to make 
sure), then R reported a strange error, saying it found a syntax error-a 
parse error at line 122 and 123 something. It's a pity I did not copy that
down. Then I found that my R is old, so I upgraded it to 2.6.2 with apt-get
and tried it again. The situation improved, it did not say it has difficulty
parsing any more, but it reported the error I have posted.

   Another thing is that I have a R 2.5.1 under windows, yesterday I tried 
to use install.packages to install fCalendar under it, and everything 
worked smoothly, it was a success, no problem whatsoever.

   As a common R user, I am not capable of debugging it. I hope R gurus 
like prof Brian Ripley could have a closer look at my problem.

   Thanks a lot!

Yan Wang
Georgia Institute of Technology
School of Industrial and Systems Engineering

E-mail address:   ywang67 at isye.gatech.edu
On Sun, 23 Mar 2008, Prof Brian Ripley wrote:

            
6 days later
#
On Sun, Mar 23, 2008 at 01:42:01PM -0400, Yan Wang wrote:
Please see the R FAQ; several volunteers provide up-to-date versions
of R for Ubuntu.

You also may want to consult your Ubuntu documentation about learning
what packages are available:  

     $ sudo apt-get install r-cran-fcalendar

would get you a binary of fCalendar onto your system (though it may be
the version that was current when your version of Ubuntu was build). I
presume you know that your version of Ubuntu is one release behind too.

Hope this helps, Dirk