Issue this first:
library(chron)
On Mon, Feb 1, 2010 at 2:42 PM, Gabor Grothendieck
wrote:
> Try this
>
>> Lines <- "Date Time Data
> + 20091209 1200 1
> + 20091209 1500 2
> + 20091209 1800 3
> + 20091210 800 4
> + 20091210 1000 5
> + 20091210 1600 6"
>>
>> toChron <- function(x) as.chron(sprint
Try this
> Lines <- "Date Time Data
+ 20091209 1200 1
+ 20091209 1500 2
+ 20091209 1800 3
+ 20091210 800 4
+ 20091210 1000 5
+ 20091210 1600 6"
>
> toChron <- function(x) as.chron(sprintf("%d %04d", x[,1], x[,2]), "%Y%m%d
> %H%M")
>
> DF <- read.table(textConnection(Lines), header = TRUE)
> toChr
Also, although you don't need it to accomplish what you want, you were
probably looking for the as.character function instead of toString...
Tam Le wrote:
Hello,
Please excuse me if this question has been asked before. I'm new to R, and
have been trying to google the answers without any succes
Hello,
Tam Le wrote:
Hello,
Please excuse me if this question has been asked before. I'm new to R, and
have been trying to google the answers without any success.
I would like to convert a set of date and time into R date-time class. Right
now, the dates and times are in integer format, so I f
Hello,
Please excuse me if this question has been asked before. I'm new to R, and
have been trying to google the answers without any success.
I would like to convert a set of date and time into R date-time class. Right
now, the dates and times are in integer format, so I first need to convert
the
5 matches
Mail list logo