tatooheene::df_fp.friction_period() to:
The function is . Column names reflect the CBS table embedded in
df_fp.
df_fp %>%
select(Year,
`Friction period in days`,
`Friction period days average over 5 years`,
`Friction period in weeks`,
`Friction period weeks average over 5 years`) %>%
head()
#> # A tibble: 6 × 5
#> Year `Friction period in days` Friction period days …¹ Friction period in w…²
#> <dbl> <dbl> <dbl> <dbl>
#> 1 1997 NA NA NA
#> 2 1998 87.6 NA 12.5
#> 3 1999 97.5 NA 13.9
#> 4 2000 103. NA 14.7
#> 5 2001 101. NA 14.5
#> 6 2002 98.3 97.5 14.0
#> # ℹ abbreviated names: ¹`Friction period days average over 5 years`,
#> # ²`Friction period in weeks`
#> # ℹ 1 more variable: `Friction period weeks average over 5 years` <dbl>tatooheene::friction_period(
year = 2015:2019,
units = c("days", "weeks"),
avg = "1yr" # try c("1yr","5yr") to get four columns
)
#> # A tibble: 5 × 3
#> Year `Friction period in days` `Friction period in weeks`
#> <dbl> <dbl> <dbl>
#> 1 2015 87.2 12.5
#> 2 2016 92.2 13.2
#> 3 2017 101. 14.5
#> 4 2018 107. 15.3
#> 5 2019 111. 15.9“Year out of range …”
You asked for a year outside range(df_fp$Year). Use a valid
year or pass NULL for all years.
“For output = "value", provide exactly one
year and a single (units, avg) combination.”
Single value mode needs exactly one year and one
(units, avg).