Skip to content

Commit

Permalink
PUBDEV-2150 Imports time columns from H2O as Date columns in R.
Browse files Browse the repository at this point in the history
  • Loading branch information
bghill committed Sep 26, 2015
1 parent 68e897e commit 42c2bb4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion h2o-r/h2o-package/R/frame.R
Expand Up @@ -1730,7 +1730,10 @@ as.data.frame.Frame <- function(x, ...) {
# Substitute NAs for blank cells rather than skipping
df <- read.csv((tcon <- textConnection(ttt)), blank.lines.skip = FALSE, na.strings = "", colClasses = colClasses, ...)
close(tcon)
# FIXME now convert all date columns to POSIXct
# Convert all date columns to POSIXct
dates <- attr(x, "types") %in% "time"
if (length(dates) > 0) # why do some frames come in with no attributes but many columns?

This comment has been minimized.

Copy link
@jangorecki

jangorecki Nov 17, 2016

Contributor

this should be sum(dates) > 0 AFAIU, will fix it in PR #497

for (i in 1:length(dates)) { if (dates[[i]]) class(df[[i]]) = "POSIXct" }
df
}

Expand Down

0 comments on commit 42c2bb4

Please sign in to comment.