tidyverse / hms

A simple class for storing time-of-day values
https://hms.tidyverse.org/
Other
138 stars 25 forks source link

Need as.data.frame method #7

Closed hadley closed 8 years ago

hadley commented 8 years ago

Something like this:

as.data.frame.hms <- function(x, row.names = NULL, optional = FALSE, ...) {
  df <- list(x)
  names(df) <- deparse(substitute(x))
  class(df) <- "data.frame"
  attr(df, "row.names") <- .set_row_names(length(x))
  x
}

as.data.frame(x = hms(100))

(but that doesn't work so I've forgotten something important)

github-actions[bot] commented 3 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.