Displaying 4 results from an estimated 4 matches for "datetime3".
Did you mean:
datetime
2012 Mar 30
1
lubridate:ymd_hm and coercion of class POSIXct. Smooth way to restore the date format.
...he result to the data frame on rows with complete data
x$datetime2[!is.na(x$time)] <- ymd_hm(x$datetime[!is.na(x$time)])
x
class(ymd_hm(x$datetime[!is.na(x$time)]))
class(x$datetime2)
# POSIXct is coerced to numeric. Fair enough
# try to pre-allocate a vector and convert it to class POSIXct:
x$datetime3 <- NA
class(x$datetime3) <- "POSIXct"
x
x$datetime3[!is.na(x$time)] <- ymd_hm(x$datetime[!is.na(x$time)])
x
# something happened with the time (15:00 vs 17:00). A time zone issue?
tz(x$datetime3[!is.na(x$time)])
Sys.timezone()
x$datetime3 <- with_tz(x$datetime3, "CEST&...
2010 Oct 13
1
Date Time Objects
I am trying to convert an array from numeric values back to date and time
format. The code I have used is as follows;
for (i in 0:(length(DateTime3)-1)) {
DateTime3[i] <- (strptime(start, "%m/%d/%Y %H:%M")+ i*interval)
where start <- [1] "1/1/1981 00:00"
However the created array (DateTime3) contains [1,] 347156400 347157600
347158800 347160000 347161200 347162400 347163600 NA
Does anyone know how I can change D...
2011 Feb 02
0
Need help subsetting time series data
...|min==31|min==32|min==33|min==34)
>datetime<-paste(MR1001$date,MR1001$time)
>datetime<-as.POSIXct(strptime(as.character(datetime), tz="UTC", "%m/%d%Y
%H:%M:%S"))
>datetime2<-datetime[-1]
>datetime2[length(datetime)]<-datetime2[length(datetime)-1]+3600
>datetime3<-datetime2-datetime
>datetime4<-datetime3/60
>datetime5<-as.numeric(datetime4)
>t1$diff<-datetime5
This didn't work either though, because when an unwanted fix occurred after
a wanted fix the value in the "diff" column was small, and I couldn't figure
out how...
2010 Oct 15
0
nomianl response model
...lp at r-project.org
Subject: [R] Date Time Objects
Message-ID: <1286970711066-2993524.post at n4.nabble.com>
Content-Type: text/plain; charset=us-ascii
I am trying to convert an array from numeric values back to date and time
format. The code I have used is as follows;
for (i in 0:(length(DateTime3)-1)) {
DateTime3[i] <- (strptime(start, "%m/%d/%Y %H:%M")+ i*interval)
where start <- [1] "1/1/1981 00:00"
However the created array (DateTime3) contains [1,] 347156400 347157600
347158800 347160000 347161200 347162400 347163600 NA
Does anyone know how I can change D...