-
Notifications
You must be signed in to change notification settings - Fork 422
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviorpivoting ♻️pivot rectangular data to different "shapes"pivot rectangular data to different "shapes"
Description
I am trying to use gather with a data frame that contains one column with intervals created with lubridate::interval.
Sys.setenv(TZ = "Canada/Eastern")
library(lubridate, warn.conflicts = FALSE)
library(tidyr)
library(dplyr, warn.conflicts = FALSE)
df <- tibble(period = interval(as.Date("2010-01-01"), as.Date("2010-02-01")),
var1 = 1,
var2 = 2)
gather(df, var_name, var_value, var1, var2)
#> # A tibble: 2 x 3
#> period var_name var_value
#> <S4: Interval> <chr> <dbl>
#> 1 2010-01-01 UTC--2010-02-01 UTC var1 1
#> 2 NA--NA var2 2Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviorpivoting ♻️pivot rectangular data to different "shapes"pivot rectangular data to different "shapes"