Skip to content
Prev 293703 / 398513 Next

creating a new column assigning values of other columns

Hi Michael,
Yes, I tried ifelse() before but this function returns a numeric value. When I try to convert it back to POSIXct I get a <NA>*. If I use if else I get a POSIXct output although it does not return a correct answer (it only returns y$timepos even when the condition "h<9" fails to be met).
Attached the outputs you suggested (thanks, by the way, I didn't know dput()). Hope they go through this time.
?
Thank you,
?
Santi
?
*niga$isnight<- as.POSIXct( niga$nit, tz="GMT", format="%Y-%m-%d %H:%M:%S", origin="2007-06-19" )
?


From: R. Michael Weylandt <michael.weylandt at gmail.com>