getSeason | R Documentation |
Pdata
for season.Several seasonal schemes are available, including Petrale seasons
(1 = winter months, 2 else).
Most assessments won't require getSeason
because it is included
in cleanPacFIN. If a specialized season structure is required,
getSeason
should be run immediately after cleanPacFIN.
getSeason(
Pdata,
season_type = -1,
yearUp = NULL,
yearDown = NULL,
plotResults = FALSE,
verbose = TRUE
)
Pdata |
A data frame of biological samples
originating from the
Pacific Fishieries Information Network (PacFIN) data warehouse,
which originated in 2014. Data are pulled using sql calls, see
|
season_type |
Specify a |
yearUp |
Used to provide a list of months (i.e., |
yearDown |
Used to provide a list of months (i.e., |
plotResults |
A logical value specifying if plots should or should not be created and shown in the console. |
verbose |
A logical specifying if output should be written to the
screen or not. Good for testing and exploring your data but can be turned
off when output indicates information that you already know. The printing
of output to the screen does not affect any of the returned objects. The
default is to always print to the screen, i.e., |
An additional column season
is added to Pdata
.
No columns are modified.
Andi Stephens
test <- getSeason(
data.frame(SAMPLE_MONTH = 1:12, fishyr = rep(1:2, each = 6)),
verbose = TRUE)
testthat::expect_true(all(test[, "season"] == 1))
test <- getSeason(Pdata = test, season_type = 1, yearUp = 12)
testthat::expect_equivalent(test[test[, "fishyr"] == 3, "season"], 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.