using as.POSIXlt on multiple columns or multiple objects

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

using as.POSIXlt on multiple columns or multiple objects

Farrel Buchinsky
If I want to convert one column to date and time format that R can
understand and manipulate then I would do this


But what happens if I have many such columns and I do not want to have
my code be stuffed with 10 similar lines (one for each variable aka
column aka vector aka object)

I thought I could be clear and use the list function and do this.
list(initial$Started ,initial$Finished,full.ques$started.ful
,full.ques$finished.ful) <- lapply(list(initial$Started

But I got:
Error in list(initial$Started, initial$Finished, full.ques$started.ful,  :
  could not find function "list<-"

I am clearly missing some basic R issue here. What am I missing?

Farrel Buchinsky

[hidden email] mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.