keep_sundays_and_latest_date: Keeps sundays and latest date If you provide a vector of...

keep_sundays_and_latest_dateR Documentation

Keeps sundays and latest date If you provide a vector of dates, this function will keep the sundays and the latest date

Description

Keeps sundays and latest date If you provide a vector of dates, this function will keep the sundays and the latest date

Usage

keep_sundays_and_latest_date(
  dates,
  format = "Uke isoweek_c-1/isoweek_c",
  keep_delete = TRUE
)

Arguments

dates

Vector of dates

format

Choose between: "isoyearweek_c", "Uke isoweek_c", "isoyearweek_c-1/isoyearweek_c", "Uke isoweek_c-1/isoweek_c", "date"

keep_delete

Keep everything in the same format as provided

Examples

fhiplot::keep_sundays_and_latest_date(
  dates = seq.Date(as.Date("2020-01-01"), as.Date("2020-02-01"), by=1),
  format = "isoyearweek_c",
  keep_delete = TRUE
)

fhiplot::keep_sundays_and_latest_date(
  dates = seq.Date(as.Date("2020-01-01"), as.Date("2020-02-01"), by=1),
  format = "Uke isoweek_c",
  keep_delete = TRUE
)

fhiplot::keep_sundays_and_latest_date(
  dates = seq.Date(as.Date("2020-01-01"), as.Date("2020-02-01"), by=1),
  format = "isoyearweek_c-1/isoyearweek_c",
  keep_delete = TRUE
)

fhiplot::keep_sundays_and_latest_date(
  dates = seq.Date(as.Date("2020-01-01"), as.Date("2020-02-01"), by=1),
  format = "Uke isoweek_c-1/isoweek_c",
  keep_delete = TRUE
)

fhiplot::keep_sundays_and_latest_date(
  dates = seq.Date(as.Date("2020-01-01"), as.Date("2020-02-01"), by=1),
  format = "date",
  keep_delete = TRUE
)

fhiplot::keep_sundays_and_latest_date(
  dates = seq.Date(as.Date("2020-01-01"), as.Date("2020-02-01"), by=1),
  format = "date",
  keep_delete = FALSE
)

folkehelseinstituttet/fhiplot documentation built on March 25, 2022, 7:59 a.m.