-
Notifications
You must be signed in to change notification settings - Fork 420
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviormissing values 💀
Description
I've noticed fill() does not support value type period. I didn't see anything in the documentation mentioning this case or any warnings that certain values couldn't be filled.
library(tidyverse)
library(lubridate)
#>
#> Attaching package: 'lubridate'
#> The following objects are masked from 'package:base':
#>
#> date, intersect, setdiff, union
set.seed(24)
n <- 2
df <- tibble(
my_type = sample('a', n, replace = T),
time = period(12, units = 'second'),
value = sample(c(NA, 5), n, replace = F)
)
df[2,2] = NA
df
#> # A tibble: 2 x 3
#> my_type time value
#> <chr> <Period> <dbl>
#> 1 a 12S 5
#> 2 a NA NA
df %>%
group_by(my_type) %>%
fill(everything(), .direction = 'down')
#> # A tibble: 2 x 3
#> # Groups: my_type [1]
#> my_type time value
#> <chr> <Period> <dbl>
#> 1 a 12S 5
#> 2 a NA 5Created on 2021-02-18 by the reprex package (v1.0.0)
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviormissing values 💀