[R] extract values ​​for the dates and a new column

RMSOPS ricardosousa2000 at clix.pt
Wed Mar 14 15:55:10 CET 2012


#add column Start
Hello

Good Afternoon I am trying to create a new column in the data frame, the
target is based on a column of dates to extract a value of life and add a
new column to data frame

f<-x.res$T-x.res$duration
Dataset$StarEvent<-(as.character.POSIXt(f))


x.sub$T is:
[1] "2006-10-31 20:10:35 EST" "2006-10-31 20:11:08 EST" "2006-10-31 20:11:21
EST"
 [4] "2006-10-31 20:12:16 EST" "2006-10-31 20:13:20 EST" "2006-10-31
20:13:28 EST"

x$duration
159
234
345
35
544


Error in `$<-.data.frame`(`*tmp*`, "StarEvent", value = c("2006-10-31
20:08:03",  : 
  replacement has 18 rows, data has 103)

--
View this message in context: http://r.789695.n4.nabble.com/extract-values-for-the-dates-and-a-new-column-tp4472052p4472052.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list