On Dec 25, 2010, at 2:25 PM, Dimitri Shvorob wrote:
df = structure(list(t = structure(c(1033963406.044, 1033974144.847,
+ 1033988418.836), class = c("POSIXt", "POSIXct"))), .Names = "t",
row.names
= c(NA,
+ 3L), class = "data.frame")
df$min = trunc(df$t,units="mins")
does not work,
??? s
Dimitri Shvorob wrote:
.. One issue with the solution proposed by Jeff is that the transformed
column does not have the original's type:
x = structure(list(time = structure(c(1020232904.818, 1020232904.818
), class = c("POSIXt", "POSIXct"), tzone = ""), price = c(321,
323.5), minute = c(102023
Dimitri Shvorob wrote:
df = structure(list(t = structure(c(1033963406.044, 1033974144.847,
+ 1033988418.836), class = c("POSIXt", "POSIXct"))), .Names = "t", row.names
= c(NA,
+ 3L), class = "data.frame")
df$min = trunc(df$t,units="mins")
does not work, Jeff; you will see that my original p
.. One issue with the solution proposed by Jeff is that the transformed
column does not have the original's type:
> x = structure(list(time = structure(c(1020232904.818, 1020232904.818
), class = c("POSIXt", "POSIXct"), tzone = ""), price = c(321,
323.5), minute = c(1020232860, 1020232860)), .Na
df = structure(list(t = structure(c(1033963406.044, 1033974144.847,
+ 1033988418.836), class = c("POSIXt", "POSIXct"))), .Names = "t", row.names
= c(NA,
+ 3L), class = "data.frame")
df$min = trunc(df$t,units="mins")
does not work, Jeff; you will see that my original post suggests familiarity
Dimitri Shvorob wrote:
Nor would I call this much of an improvement in clarity... what about
"min"? You want to know the minimum?
LOL. (And apologies for the insensitivity). Thank you for help, Jeff. This
works, but I am still curious to see a solution based on "trunc", if anyone
can find
> Nor would I call this much of an improvement in clarity... what about
"min"? You want to know the minimum?
LOL. (And apologies for the insensitivity). Thank you for help, Jeff. This
works, but I am still curious to see a solution based on "trunc", if anyone
can find it.
--
View this message i
Dimitri Shvorob wrote:
df$dt <- as.Date(df$t)
Thank you, David, but I need a *time* value. "day" was a confusing special
case; how about "min"?
Your original question was NOT clear on this point... it was not David's
fault your question was confusing, and you haven't even hinted at an
> df$dt <- as.Date(df$t)
Thank you, David, but I need a *time* value. "day" was a confusing special
case; how about "min"?
--
View this message in context:
http://r.789695.n4.nabble.com/Lost-in-POSIX-tp3052768p3053146.html
Sent from the R help mailing list archive at Nabble.com.
On Nov 21, 2010, at 3:52 PM, Dimitri Shvorob wrote:
Can someone please fix this snippet? (i.e. append to the dataframe a
column
containing "truncated" time value)?
df = structure(list(t = structure(c(1033963406.044, 1033974144.847,
1033988418.836), class = c("POSIXt", "POSIXct"))), .Names
Can someone please fix this snippet? (i.e. append to the dataframe a column
containing "truncated" time value)?
df = structure(list(t = structure(c(1033963406.044, 1033974144.847,
1033988418.836), class = c("POSIXt", "POSIXct"))), .Names = "t", row.names =
c(NA,
3L), class = "data.frame")
# Tr
11 matches
Mail list logo