Description Usage Arguments Examples
View source: R/data_manipulation.R
Generates a flavor of statistical week values typically encountered in fisheries management related applications. Allows the start date of the stat week to be set to either Sunday or Monday. Stat weeks will always be numbered starting at one on the first day of the year.
1 | fish_stat_week(dts, start_day = "Mon")
|
dts |
A vector of date values formatted as character |
start_day |
Starting day of the stat week. Options are "Mon" or "Sun" |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # Generate a vector of date values
dtv = seq(as.Date("2017-01-01"),
as.Date("2017-01-15"),
by = "day")
# Generate vector of stat week values
stat_week = fish_stat_week(dtv)
# Create dataframe with date values
fish_catch = tibble::tibble(survey_date = dtv,
catch = as.integer(abs(rnorm(length(dtv)) * 10)))
# Add a stat_week column to fish_catch
fish_catch$stat_week = fish_stat_week(fish_catch$survey_date)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.