Re: [R] colClasses

From: jim holtman <jholtman_at_gmail.com>
Date: Thu 22 Jun 2006 - 06:12:12 EST

Is this what you want:

> x <- "date,value

+ 2006-5-5,1
+ 2006-5-10,2
+ 2006-5-20,3
+ 2006-5-30,4"

> y <- textConnection(x)
> z <- read.csv(y, colClasses=c("POSIXct", 'integer'))
>
> z
        date value
1 2006-05-05     1
2 2006-05-10     2
3 2006-05-20     3
4 2006-05-30     4



On 6/21/06, Kerpel, John <John.Kerpel@infores.com> wrote:
>
> Hi Folks!
>
>
>
> I'm reading in some data from a .csv file that has a date column.
>
>
>
> How do I use colClasses to get read.csv to recognize the date column?
> The documentation on this seems to be nil -
>
> And yes, I've read help and R Data Import/Export and can't figure out
> what the colClasses syntax is.
>
>
>
> Thanks,
>
>
>
> john
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>

-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390 (Cell)
+1 513 247 0281 (Home)

What is the problem you are trying to solve?

	[[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Thu Jun 22 06:15:14 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 22 Jun 2006 - 08:12:23 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.