Skip to content

Commit

Permalink
Update documentation of physiologies function.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdgamboa committed Dec 14, 2023
1 parent b006b48 commit f35bd3e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
14 changes: 9 additions & 5 deletions R/physiologies.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@

#' Physiologies
#' Import phsiologies
#'
#' \code{physiologies} imports data from the
#' Google spreadsheets (https://drive.google.com/drive/folders/1i2UAolVWAYa7UnETNnCs0BDWjKPp3ev5).
#' Google spreadsheets at https://drive.google.com/drive/folders/1i2UAolVWAYa7UnETNnCs0BDWjKPp3ev5.
#' This function (and its internal functions) do minimal changes to the
#' imported data. These changes are only meant to match data coming from
#' different sources, and attaching information needed for further processing,
#' such as source and attribute type.
#'
#' @param keyword Character vector with one or more valid keywords.
#' Valid keyboards can be checked with \code{showPhys}. If 'all', all
Expand All @@ -27,7 +31,7 @@ physiologies <- function(keyword = 'all', full_source = FALSE) {
if (cond1 && cond2) {
spreadsheets <- .importSpreadsheets(keyword = keyword)
spreadsheets <- spreadsheets[names(spreadsheets) %in% keyword]
bacdive <- .reshapeBacDive(.getBacDive(verbose = FALSE)) ## This functions are in a different file
bacdive <- .reshapeBacDive(.getBacDive(verbose = FALSE))
bacdive <- bacdive[names(bacdive) %in% keyword]
physiologies <- vector('list', length(keyword))
for (i in seq_along(keyword)) {
Expand Down Expand Up @@ -62,7 +66,7 @@ physiologies <- function(keyword = 'all', full_source = FALSE) {
dplyr::distinct()

if (full_source) {
df$Attribute_source <- df$full_source ## added with .addSourceInfo
df$Attribute_source <- df$full_source
}
df$full_source <- NULL

Expand All @@ -74,7 +78,7 @@ physiologies <- function(keyword = 'all', full_source = FALSE) {

df <- as.data.frame(df[, vapply(df, \(y) !all(is.na(y)), logical(1))])

## TODO this code should be somewhere else
## TODO this code could be somewhere else
if (unique(df$Attribute_group) == 'aerophilicity') {
df <- .homogenizeAerophilicityAttributeNames(df)
}
Expand Down
2 changes: 1 addition & 1 deletion man/dot-checkColumnValues.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/dot-template.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/fattyAcidComposition.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions man/physiologies.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f35bd3e

Please sign in to comment.