Re: [Rd] Why is strptime always returning a vector of length 9 ?

2009-08-09 Thread Martin Maechler
> "l" == laurent > on Sun, 09 Aug 2009 21:45:07 +0200 writes: l> Thanks. It seems that the source of my confusion comes l> from using first using str() (and then once on the wrong l> track, it is easier to miss the information a man page l> that also describes POSIXc

[Rd] model.matrix evaluation challenges

2009-08-09 Thread Ben Bolker
I am having difficulty with evaluation/environment construction for a formula to be evaluated by model.matrix(). Basically, I want to construct a model matrix that first looks in "newdata" for the values of the model parameters, then in "obj...@data". Here's what I've tried: 1. model.matrix(~

Re: [Rd] Problem using model.frame with argument subset in own function

2009-08-09 Thread Gavin Simpson
On Sun, 2009-08-09 at 11:32 -0500, Douglas Bates wrote: > On Sat, Aug 8, 2009 at 1:31 PM, Gavin Simpson wrote: > > Dear List, > > > I am writing a formula method for a function in a package I maintain. I > > want the method to return a data.frame that potentially only contains > > some of the vari

Re: [Rd] Why is strptime always returning a vector of length 9 ?

2009-08-09 Thread laurent
Thanks. It seems that the source of my confusion comes from using first using str() (and then once on the wrong track, it is easier to miss the information a man page that also describes POSIXct that is itself a vector of length equal to the number of entries it contains). With the current exampl

Re: [Rd] odbcConnectExcel on non-Windows?

2009-08-09 Thread Marc Schwartz
Hi Spencer, Unfortunately, the two Perl modules in question, Text::CSV_XS and Encode, are not pure Perl modules as they contain C code. This means that the modules need to be compiled either beforehand as a pre-packaged binary or during installation, both for the Perl version that is inst

Re: [Rd] odbcConnectExcel on non-Windows?

2009-08-09 Thread spencerg
Dear Gabor: Good suggestion. I will probably do that if "WriteXLS" is not installed or if it is but "testPerl()" is FALSE. Thanks, Spencer Gabor Grothendieck wrote: Instead of writing out an xls file you could write out a file in any format that Excel can read, e.g. csv, wit

Re: [Rd] odbcConnectExcel on non-Windows?

2009-08-09 Thread spencerg
Dear Marc: In spite of your efforts to help me, I still get an "F" in your "WriteXLS" class. Consider the following: > library(WriteXLS) > help(pac=WriteXLS) > testPerl() Perl found. The following Perl modules were not found on this system: Text::CSV_XS If you have more than one P

Re: [Rd] odbcConnectExcel on non-Windows?

2009-08-09 Thread Gabor Grothendieck
Instead of writing out an xls file you could write out a file in any format that Excel can read, e.g. csv, with a suitable renaming of your function. On Sun, Aug 9, 2009 at 1:04 PM, spencerg wrote: > Hello: > >     What should I do regarding code to write an Excel file in a non-Windows > platform?

Re: [Rd] odbcConnectExcel on non-Windows?

2009-08-09 Thread Dirk Eddelbuettel
On 9 August 2009 at 12:04, spencerg wrote: | What should I do regarding code to write an Excel file in a | non-Windows platform? [...] | What would you suggest we do about this? [...] | If there is a better way to handle this, I would like to know. http://cran.r-project.org

[Rd] odbcConnectExcel on non-Windows?

2009-08-09 Thread spencerg
Hello: What should I do regarding code to write an Excel file in a non-Windows platform? The "sos" package [new version of "RSiteSearch"] on R-Forge includes "writeFindFn2xls", which starts with "require(RODBC)". The next line calls "odbcConnectExcel". This works under Window

Re: [Rd] Why is strptime always returning a vector of length 9 ?

2009-08-09 Thread Jeff Ryan
The reason is in the ?strptime under value: 'strptime' turns character representations into an object of class '"POSIXlt"'. The timezone is used to set the 'isdst' component and to set the '"tzone"' attribute if 'tz != ""'. And POSIXlt is a list of length 9. HTH Jeff On Sun, Aug 9,

Re: [Rd] Problem using model.frame with argument subset in own function

2009-08-09 Thread Douglas Bates
On Sat, Aug 8, 2009 at 1:31 PM, Gavin Simpson wrote: > Dear List, > I am writing a formula method for a function in a package I maintain. I > want the method to return a data.frame that potentially only contains > some of the variables in 'data', as specified by the formula. The usual way to call

Re: [Rd] Why is strptime always returning a vector of length 9 ?

2009-08-09 Thread Gabor Grothendieck
Try this to see its components: > str(unclass(xd)) List of 9 $ sec : num [1:6] 0 0 0 0 0 0 $ min : int [1:6] 0 0 0 0 0 0 $ hour : int [1:6] 0 0 0 0 0 0 $ mday : int [1:6] 9 31 12 12 30 30 $ mon : int [1:6] 2 4 10 10 6 6 $ year : int [1:6] 107 107 108 108 109 109 $ wday : int [1:6] 5 4 3

[Rd] Why is strptime always returning a vector of length 9 ?

2009-08-09 Thread laurent
Dear List, I am having an issue with strptime (see below). I can reproduce it on R-2.8, R-2.9, and R-2.10-dev, I tempted to see either a bug or my misunderstanding (and then I just don't currently see where). # setup: x <- c("March 09, 2007", "May 31, 2007", "November 12, 2008", "November 12, 20