-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standardising parameters throughout austraits
- replace all `@param austraits` and `@param aus_traits` with `@param database` - replace all references to just the traits table (previously x, data, trait( with `@param trait_data` - standardise description of parameters - currently using `@param database traits.build database (list object)` so people realise it is a relational database, but could change to `@param database traits.build database`
- Loading branch information
Showing
21 changed files
with
208 additions
and
207 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
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
#' @title Check compatibility of traits.build object | ||
#' @description Function to check whether the data object has been compiled by the traits.build workflow and | ||
#' therefore has a data structure that is appropriate for use with austraits functions. | ||
#' @param austraits dataframe generated by traits build | ||
#' @param database traits.build database (list object) | ||
#' | ||
#' @return logical (T/F) output and messaging for uncompatible versions | ||
#' | ||
#' @examples | ||
#' \dontrun{ | ||
#' check_compatibility(austraits) | ||
#' check_compatibility(database) | ||
#' } | ||
#' @author Elizabeth Wenk - [email protected] | ||
|
||
check_compatibility <- function(austraits) { | ||
check_compatibility <- function(database) { | ||
|
||
if (is.null(austraits$metadata)) { | ||
if (is.null(database$metadata)) { | ||
|
||
compatible <- FALSE | ||
|
||
|
@@ -22,7 +22,7 @@ check_compatibility <- function(austraits) { | |
} else { | ||
|
||
compiled_by_traits.build <- | ||
austraits$metadata$related_identifiers %>% | ||
database$metadata$related_identifiers %>% | ||
convert_list_to_df2() %>% | ||
dplyr::filter(relation_type == "isCompiledBy") |> | ||
dplyr::filter(stringr::str_detect(identifier, "github.com/traitecoevo/traits.build")) | ||
|
@@ -46,13 +46,13 @@ check_compatibility <- function(austraits) { | |
|
||
#' Check compatibility of traits table | ||
#' | ||
#' @param traits table in traits.build object | ||
#' @param trait_data the traits table in a traits.build database | ||
#' | ||
#' @return logical, TRUE indicating version traits table came from traits.build version > 1.0 | ||
|
||
check_traits_compatibility <- function(traits){ | ||
check_traits_compatibility <- function(trait_data){ | ||
# Check compatibility using column | ||
if(any(names(traits) %in% c("treatment_context_id", "repeat_measurements_id"))){ | ||
if(any(names(trait_data) %in% c("treatment_context_id", "repeat_measurements_id"))){ | ||
compatible <- TRUE | ||
} else | ||
compatible <- FALSE | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
#' | ||
#' @description Function to subset of all data associated with a particular taxon from a traits.build relational database. | ||
#' | ||
#' @param database a large list of tibbles built by `traits.build` workflow | ||
#' @param database traits.build database (list object) | ||
#' @param family character string of family or families | ||
#' @param genus character string of genus or genera | ||
#' @param taxon_name character string of taxon name(s) | ||
|
@@ -19,8 +19,8 @@ | |
#' | ||
#' @examples | ||
#' \dontrun{ | ||
#'extract_taxa(austraits, family = "Proteaceae") | ||
#'extract_taxa(austraits, genus = "Acacia") | ||
#'extract_taxa(database = austraits, family = "Proteaceae") | ||
#'extract_taxa(database = austraits, genus = "Acacia") | ||
#' } | ||
#' @author Fonti Kar - [email protected] | ||
#' @export | ||
|
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
#' @description Function to subset all data associated with a particular trait from a traits.build relational database. | ||
#' | ||
#' @usage extract_trait(database, trait_names, taxon_names) | ||
#' @param database a large list of tibbles built by `traits.build` | ||
#' @param database traits.build database (list object) | ||
#' @param trait_names character string of trait(s) for which data will be extracted | ||
#' @param taxon_names optional argument, specifying taxa for which data will be extracted | ||
#' @return List of tibbles containing all traits.build data and metadata for the specified trait(s). | ||
|
@@ -19,7 +19,7 @@ | |
#' | ||
#' @examples | ||
#' \dontrun{ | ||
#'extract_trait(database, "wood_density", taxon_name = "Acacia celsa") | ||
#'extract_trait(database = austraits, trait_names = "wood_density", taxon_names = "Acacia celsa") | ||
#' } | ||
#' @author Daniel Falster - [email protected] | ||
#' @export | ||
|
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
Oops, something went wrong.