-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from NOAA-EDAB/dev
Cleaned up documentation + added function
- Loading branch information
Showing
36 changed files
with
516 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,11 @@ Date: 2015-03-03 | |
Authors@R: c(person(given = "Sean", | ||
family = "Lucey", | ||
email = "[email protected]", | ||
role = c("aut", "cre")), | ||
role = c("aut")), | ||
person(given = "Andy", | ||
family = "Beet", | ||
email = "[email protected]", | ||
role = c("aut"), | ||
role = c("aut","cre"), | ||
comment = c(ORCID = "0000-0001-8270-7090"))) | ||
License: file LICENSE | ||
Encoding: UTF-8 | ||
|
@@ -36,5 +36,9 @@ Suggests: | |
knitr, | ||
rmarkdown, | ||
markdown, | ||
kableExtra | ||
kableExtra, | ||
DT | ||
VignetteBuilder: knitr | ||
Depends: | ||
R (>= 2.10) | ||
LazyData: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#' Argument Flag check | ||
#' | ||
#' check to make sure arguments passed do not contradict each other | ||
#' @inheritParams get_survdat_data | ||
#' | ||
#' @noRd | ||
|
||
# We can either create error messages (like below) or fix argument specs | ||
check_argument_validation <- function(getLengths,getBio,getWeightLength) { | ||
|
||
if (getWeightLength) { | ||
if(!getLengths) { | ||
# Weight at Length Data ----------------------------------------------------- | ||
stop("Can not calculate weight at length without lengths... | ||
Set getLengths = TRUE.") | ||
} | ||
} | ||
|
||
if (getBio) { | ||
if(!getLengths) { | ||
stop("Can not obtain individual fish biological data without lengths ... | ||
Set getLengths = TRUE") | ||
} | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#' Sample data pull with spcies specific biological data | ||
#' | ||
#' get_survdat_data(channel, getLengths = T, getWeightLength = F, conversion.factor = F, getBio = T) | ||
#' | ||
#' @format A data frame with n rows and m variables | ||
#' | ||
#' @family sampleData | ||
#' | ||
#' | ||
#' | ||
"sampleBio" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#' Sample data pull with species lengths and predicted weights | ||
#' | ||
#' get_survdat_data(channel, getLengths=F, getWeightLength = T, conversion.factor=F) | ||
#' | ||
#' @format A data frame with n rows and m variables | ||
#' | ||
#' @family sampleData | ||
#' | ||
#' | ||
#' | ||
"sampleLengthWeight" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#' Sample data pull with species lengths | ||
#' | ||
#' get_survdat_data(channel, getLengths=T, conversion.factor=F) | ||
#' | ||
#' @format A data frame with n rows and m variables | ||
#' | ||
#' @family sampleData | ||
#' | ||
#' | ||
#' | ||
"sampleLengths" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#' Sample raw data pull | ||
#' | ||
#' get_survdat_data(channel, getLengths=F,conversion.factor=F) | ||
#' | ||
#' @format A data frame with n rows and m variables | ||
#' | ||
#' @family sampleData | ||
#' | ||
#' | ||
#' | ||
"sampleRaw" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#' Sample raw data pull with conversion factors applied | ||
#' | ||
#' get_survdat_data(channel, getLengths = F, conversion.factor = T) | ||
#' | ||
#' @format A data frame with n rows and m variables | ||
#' | ||
#' @family sampleData | ||
#' | ||
#' | ||
#' | ||
"sampleRawWithConversion" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#' Create sample data fro vignettes | ||
#' | ||
#' | ||
#' | ||
|
||
channel <- dbutils::connect_to_database("server","user") | ||
# pull raw data | ||
raw <- survdat::get_survdat_data(channel, | ||
getLengths = F, | ||
conversion.factor = F) | ||
|
||
# pull lengths | ||
len <- survdat::get_survdat_data(channel, | ||
getLengths = T, | ||
conversion.factor = F) | ||
# pull lengths with predicted weights | ||
lenwgt <- survdat::get_survdat_data(channel, | ||
getLengths = T, | ||
getWeightLength = T, | ||
conversion.factor = F) | ||
# Pull bio data | ||
bio <- survdat::get_survdat_data(channel, | ||
getLengths = T, | ||
getWeightLength = F, | ||
conversion.factor = F, | ||
getBio = T) | ||
|
||
# Pull raw data with conversion factors | ||
rawfact <- survdat::get_survdat_data(channel, | ||
getLengths = F, | ||
conversion.factor = T) | ||
|
||
overwrite <- F | ||
set.seed(143) | ||
rowsToSample <- sample(1:nrow(raw$survdat),20) | ||
|
||
# Generate sample data | ||
# raw | ||
sampleRaw <- raw$survdat |> | ||
dplyr::slice(rowsToSample) |> | ||
dplyr::as_tibble() | ||
|
||
usethis::use_data(sampleRaw,overwrite = overwrite) | ||
|
||
#lengths | ||
sampleLengths <- len$survdat |> | ||
dplyr::slice(rowsToSample) |> | ||
dplyr::as_tibble() | ||
|
||
usethis::use_data(sampleLengths,overwrite = overwrite) | ||
|
||
# lengthweight | ||
sampleLengthWeight <- lenwgt$survdat |> | ||
dplyr::slice(rowsToSample) |> | ||
dplyr::as_tibble() | ||
|
||
usethis::use_data(sampleLengthWeight,overwrite = overwrite) | ||
|
||
# BiologicalData | ||
sampleBio <- bio$survdat |> | ||
dplyr::slice(rowsToSample) |> | ||
dplyr::as_tibble() | ||
|
||
usethis::use_data(sampleBio,overwrite = overwrite) | ||
|
||
# raw with conversion factor | ||
sampleRawWithConversion <- rawfact$survdat |> | ||
dplyr::slice(rowsToSample) |> | ||
dplyr::as_tibble() | ||
|
||
usethis::use_data(sampleRawWithConversion,overwrite = overwrite) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.