Re: [Rd] A couple of issues with colClasses/setAs

2004-09-08 Thread Prof Brian Ripley
On 8 Sep 2004, Peter Dalgaard wrote: > Prof Brian Ripley <[EMAIL PROTECTED]> writes: > > > > etc? Or perhaps it is better with a catchall "Date-fmt", i.e., e.g., > > > "Date-%Y%m%d"? That'd be fairly easy to code: > > > > > > else if (length(grep("^Date-",colClasses[i]))) > > > as.Dat

Re: [Rd] A couple of issues with colClasses/setAs

2004-09-08 Thread Peter Dalgaard
Prof Brian Ripley <[EMAIL PROTECTED]> writes: > > etc? Or perhaps it is better with a catchall "Date-fmt", i.e., e.g., > > "Date-%Y%m%d"? That'd be fairly easy to code: > > > > else if (length(grep("^Date-",colClasses[i]))) > > as.Date(data[[i]], sub("^Date-(.*)$","\\1", colClasses[i])

Re: [Rd] A couple of issues with colClasses/setAs

2004-09-08 Thread Prof Brian Ripley
On 8 Sep 2004, Peter Dalgaard wrote: > Peter Dalgaard <[EMAIL PROTECTED]> writes: > > > To make it actually work, we should probably fixup the "what" that is > > being passed to scan a bit further upstreams. > > > > > > > Might be a good idea to teach colClasses about "factor". > > > > That's

Re: [Rd] A couple of issues with colClasses/setAs

2004-09-08 Thread Peter Dalgaard
Peter Dalgaard <[EMAIL PROTECTED]> writes: > To make it actually work, we should probably fixup the "what" that is > being passed to scan a bit further upstreams. > > > > Might be a good idea to teach colClasses about "factor". > > That's what I thought. Other ideas would be to predefine some s

Re: [Rd] A couple of issues with colClasses/setAs

2004-09-08 Thread Peter Dalgaard
Prof Brian Ripley <[EMAIL PROTECTED]> writes: > >From ?read.table (this is about read.table, despite the subject line, I > believe?) > > colClasses: character. A vector of classes to be assumed for the columns. > > "NULL" is not a class in my book (and certainly not one a column can > have).

Re: [Rd] A couple of issues with colClasses/setAs

2004-09-08 Thread Prof Brian Ripley
>From ?read.table (this is about read.table, despite the subject line, I believe?) colClasses: character. A vector of classes to be assumed for the columns. "NULL" is not a class in my book (and certainly not one a column can have). So no wonder it does not work, and it is not a bug not to wor