diff --git a/R/get_name_keys.R b/R/get_name_keys.R index 9052cd3..92ab760 100644 --- a/R/get_name_keys.R +++ b/R/get_name_keys.R @@ -3,7 +3,6 @@ #' #' @param df character) Data frame with taxon names #' @param name_col (character) Column for taxon names. Include taxonomic authority for better matching -#' @param tax_status (character) Default `any` provides all taxonomic, otherwise 'accepted' #' @param match (character) Controls the output of the search. Use `single` to #' force a single match result that has the highest confidence or `any` to return #' all possible matches sorted in order of confidence @@ -12,15 +11,15 @@ #' #' @return Returns a data frame with accepted GBIF and POWO identifiers #' @export -#' @details Designed for batch processing. Default setting (tax_status = "accepted" and match = "single") -#' returns an accepted name with the best single match against GBIF and POWO name backbones. -#' Final list may return fewer names if there are discrepancies e.g. accepted +#' @details Designed for batch processing. Default setting (match = "single", kingdom = "plantae") +#' returns an accepted name with the best single match against GBIF and POWO name backbones (GBIF +#' only for kingdom = "fungi"). Final list may return fewer names if there are discrepancies e.g. accepted #' in GBIF, but not in POWO. Output data frame includes GBIF 'usageKey' that can be used with #' [`get_gbif_occs()`] to get occurrences from GBIF, and 'wcvp_ipni_id' that can be used with [`powo_range()`] -#' to get native ranges. To see a wider range of plausible matches adjust 'tax_status' and 'match' to 'any'. +#' to get native ranges. To see a wider range of plausible matches adjust 'match' to 'any'. # add option to determine which sources you want to search e.g. WCVP for plants, or IF for fungi -get_name_keys <- function(df, name_column, tax_status = "any", match = "single", kingdom = "plantae") { +get_name_keys <- function(df, name_column, match = "single", kingdom = "plantae") { # search terms search_names <- as.vector(unlist(df[, name_column])) @@ -28,8 +27,7 @@ get_name_keys <- function(df, name_column, tax_status = "any", match = "single", gbif_names_out <- purrr::map_dfr(search_names, name_search_gbif, - match = match, - gbif_tax_stat = tax_status) + match = match) colnames(gbif_names_out) <- paste0("GBIF", "_", colnames(gbif_names_out)) keys_df <- gbif_names_out @@ -39,8 +37,7 @@ get_name_keys <- function(df, name_column, tax_status = "any", match = "single", # get the POWO keys powo_names_out <- name_search_powo(df = df, - name_column = name_column, - powo_tax_stat = tax_status) + name_column = name_column) # bind them together - need to fix when WCVP returns multiple matches keys_df <- diff --git a/R/get_native_range.R b/R/get_native_range.R index 147f564..93244da 100644 --- a/R/get_native_range.R +++ b/R/get_native_range.R @@ -2,9 +2,9 @@ #' Get native ranges for taxa #' #' @param keys (data frame) Contain identifier for the taxon e.g. derived from [`get_name_keys()`] -#' @param keys (name_col) Column name for the identifier #' -#' @return (data frame) A list of places where a taxon occurs. +#' @return (data frame) A list of 'botanical countries' (World Geogrpahic Scheme for Recording Plant +#' Distributions) where a taxon occurs. #' @export #' #' @details Currently one option to get native ranges from (Plants of the @@ -14,7 +14,6 @@ get_native_range <- function(keys) { #,name_col # get the search ids - #search_ids <- as.vector(unlist(keys[, name_col])) search_ids <- as.vector(unlist(keys[, "wcvp_ipni_id"])) # run the powo range function through map_dfr diff --git a/R/get_occs_range.R b/R/get_occs_range.R index 5e1c757..d2c149c 100644 --- a/R/get_occs_range.R +++ b/R/get_occs_range.R @@ -2,22 +2,26 @@ #' #' @param sis_points (dataframe) SIS points file #' -#' @return Occurrence dataframe with ISO two-digit codes added +#' @return Occurrence dataframe with ISO two-digit codes added and internal id get_occs_range <- function(sis_points) { - sf_use_s2(FALSE) + sf::sf_use_s2(FALSE) # get unique lat longs sis_points_sf <- sf::st_as_sf(sis_points, coords = c("dec_long","dec_lat")) # prepare the tdwg polygon data - st_crs(LCr::tdwg_level3) <- st_crs(tdwg_level3) - st_crs(sis_points_sf) <- st_crs(tdwg_level3) + sf::st_crs(tdwg_level3) <- sf::st_crs(tdwg_level3) + sf::st_crs(sis_points_sf) <- sf::st_crs(tdwg_level3) # do the intersect out <- sf::st_join(sis_points_sf, tdwg_level3) + # tidy up the table with just the required fields + out <- out %>% dplyr::select("LEVEL3_COD", "sci_name", "internal_taxon_id") %>% + sf::st_drop_geometry() %>% unique() %>% tidyr::drop_na() %>% dplyr::arrange(sci_name) + return(out) } diff --git a/R/make_LC_points.R b/R/make_LC_points.R index d4ed1c5..b85927d 100644 --- a/R/make_LC_points.R +++ b/R/make_LC_points.R @@ -7,7 +7,7 @@ #' @param institution (character) Name of institution or affiliation #' @param range_check (boolean) TRUE if you want to carry out occurrence cleaning with native range filter #' -#' @return (list) Includes the GBIF citation, and "points" the cleaned SIS compatible point file +#' @return (list) Includes the GBIF "citation", and "points" the cleaned SIS compatible point file #' @export #' @details Designed for batch processing using keys derived from [`get_name_keys()`] @@ -52,7 +52,6 @@ make_LC_points <- res_list <- list("citation" = gbif_ref, "points" = final_points) } - #res_list <- list("citation" = gbif_ref, "points" = final_points) return(res_list) } diff --git a/R/make_sis_csvs.R b/R/make_sis_csvs.R index 327ff25..cd002b3 100644 --- a/R/make_sis_csvs.R +++ b/R/make_sis_csvs.R @@ -1,28 +1,45 @@ + #' Generate all SIS connect csv files #' -#' @param keys (data frame) Derived from [`get_name_keys()`] function. Must include at least GBIF_usageKey to obtain GBIF occurrences +#' @param unique_id (character) Unique identifier - default is the GBIF usage key #' @param first_name (character) First name of assessor #' @param second_name (character) Second name of assessor #' @param email (character) Email of assessor #' @param institution (character) Name of institution or affiliation #' @param gbif_ref (data frame) A GBIF download citation according to IUCN format. +#' @param powo_ref (data frame) A citation for use of POWO according to IUCN format. #' @param native_ranges (data frame) Native ranges derived from [`get_native_range()`] +#' @param family (character) Field containing the family +#' @param genus (character) Field containing the genus +#' @param species (character) Field containing the specific epithet +#' @param taxonomicAuthority (character) Field containing the taxonomic authority #' @param kingdom (character) Default is 'plantae', but can also be 'fungi' #' #' @return Returns an SIS compliant zip file #' @export make_sis_csvs <- - function(unique_id, wcvp_ipni_id, first_name, second_name, email, - institution, gbif_ref = NULL, native_ranges, - family, genus, species, taxonomicAuthority, - kingdom = "plantae", powo_ref = FALSE) { - + function(unique_id, + wcvp_ipni_id, + first_name, + second_name, + email, + institution, + gbif_ref = NULL, + powo_ref = FALSE, + native_ranges = NULL, + family, + genus, + species, + taxonomicAuthority, + kingdom = "plantae") + { if (kingdom == "plantae") { - # get most of the csvs here - countries <- sis_countries(unique_id, wcvp_ipni_id, native_ranges) + if (!is.null(native_ranges)) { + countries <- sis_countries(native_ranges) + } allfields <- sis_allfields(unique_id) assessments <- sis_assessments(unique_id) plantspecific <- sis_plantspecific(unique_id, kingdom) @@ -30,35 +47,62 @@ make_sis_csvs <- credits <- sis_credits(unique_id, first_name, second_name, email, affiliation = institution) taxonomy <- sis_taxonomy(unique_id, family, genus, species, taxonomicAuthority) - # need to embed map into the function, but these are a bit awkward - try again later - references <- purrr::map_dfr(unique_id, sis_references, powo_ref = powo_ref, gbif_ref) + # need to embed map into the function, but refs a bit awkward - try again later + references <- purrr::map_dfr(unique_id, sis_references, powo_ref = powo_ref, gbif_ref = gbif_ref) - return( - list(allfields = allfields, assessments = assessments, plantspecific = plantspecific, - habitats = habitats, taxonomy = taxonomy, credits = credits, references = references, - countries = countries + # list of default results - these should always be generated + results <- + list( + allfields = allfields, + assessments = assessments, + plantspecific = plantspecific, + habitats = habitats, + credits = credits, + taxonomy = taxonomy, + references = references ) - ) + + # countries df depends on native ranges, so only add countries if exists + if (exists("countries")) { + results$countries <- countries + } + + return(results) } if (kingdom == "fungi") { - # get most of the csvs here - #countries <- sis_countries(unique_id, wcvp_ipni_id, native_ranges) + if (!is.null(native_ranges)) { + countries <- sis_countries(native_ranges) + } allfields <- sis_allfields(unique_id) assessments <- sis_assessments(unique_id) plantspecific <- sis_plantspecific(unique_id, kingdom) habitats <- sis_habitats(unique_id) credits <- sis_credits(unique_id, first_name, second_name, email, affiliation = institution) - taxonomy <- sis_taxonomy(unique_id, family,genus, species, taxonomicAuthority) + taxonomy <- sis_taxonomy(unique_id, family, genus, species, taxonomicAuthority) - # need to embed map into the function, but these are a bit awkward - try again later + # need to embed map into the function, but refs a bit awkward - try again later references <- purrr::map_dfr(unique_id, sis_references, gbif_ref, powo_ref) - return( - list(allfields = allfields, assessments = assessments, plantspecific = plantspecific, - habitats = habitats, credits = credits, taxonomy = taxonomy, references = references + # list of default results - these should always be generated + results <- + list( + allfields = allfields, + assessments = assessments, + plantspecific = plantspecific, + habitats = habitats, + credits = credits, + taxonomy = taxonomy, + references = references ) - ) - } + + # countries df depends on native ranges, so only add countries if exists + if (exists("countries")) { + results$countries <- countries + } + + return(results) + + } } diff --git a/R/make_sis_occs.R b/R/make_sis_occs.R index cc95a16..727ea80 100644 --- a/R/make_sis_occs.R +++ b/R/make_sis_occs.R @@ -25,6 +25,7 @@ make_sis_occs <- function(occs_clean, first_name = "", second_name = "", institu basisOfRecord, elevation, catalogNumber, + speciesKey, gbifID ) @@ -42,6 +43,7 @@ make_sis_occs <- function(occs_clean, first_name = "", second_name = "", institu ) sis_points <- dplyr::mutate(sis_points, + internal_taxon_id = speciesKey, source = paste0("https://www.gbif.org/occurrence/", gbifID), yrcompiled = format(Sys.Date(), "%Y"), citation = institution, @@ -56,15 +58,20 @@ make_sis_occs <- function(occs_clean, first_name = "", second_name = "", institu basisofrec, "FOSSIL_SPECIMEN" = "FossilSpecimen", "HUMAN_OBSERVATION" = "HumanObservation", - "LITERATURE" = "", "LIVING_SPECIMEN" = "LivingSpecimen", "MACHINE_OBSERVATION" = "MachineObservation", - "OBSERVATION" = "", "PRESERVED_SPECIMEN" = "PreservedSpecimen", - "UNKNOWN" = "Unknown" + "UNKNOWN" = "Unknown", + "OCCURRENCE" = "HumanObservation", + "LITERATURE" = "", + "OBSERVATION" = "HumanObservation", + "MATERIAL_ENTITY" = "", + "MATERIAL_SAMPLE" = "PreservedSpecimen", + "MATERIAL_CITATION" = "PreservedSpecimen" ) ) - sis_points <- dplyr::select(sis_points, -gbifID) + + sis_points <- dplyr::select(sis_points, -speciesKey,-gbifID) return(sis_points) } diff --git a/R/name_search_gbif.R b/R/name_search_gbif.R index 7c47ebe..c972c9b 100644 --- a/R/name_search_gbif.R +++ b/R/name_search_gbif.R @@ -10,8 +10,6 @@ #' @param match (character) Controls the output of the search. Use `single` to #' force a single match result that has the highest confidence or `any` to return #' all possible matches sorted in order of confidence -#' @param gbif_tax_stat (character) Default `any` provides all taxonomic -#' matches, otherwise `accepted` returns only accepted names according to GBIF #' #' @return Returns a data frame with initial search term and matching name(s) #' @export @@ -21,8 +19,8 @@ name_search_gbif = function(name, species_rank = TRUE, - match = "single", - gbif_tax_stat = "any") { + match = "single") { + #gbif_tax_stat = "any") { #removed as was not working well # set up default results table default_tbl = gbif_name_tbl_(name) @@ -65,14 +63,14 @@ name_search_gbif = function(name, results = dplyr::arrange(results, dplyr::desc(confidence)) } - # option to filter on GBIF accepted species only - if (gbif_tax_stat == "any") { - results = results - } else { - if (gbif_tax_stat == "accepted") { - results = dplyr::filter(results, status == "ACCEPTED") - } - } + # # option to filter on GBIF accepted species only + # if (gbif_tax_stat == "any") { + # results = results + # } else { + # if (gbif_tax_stat == "accepted") { + # results = dplyr::filter(results, status == "ACCEPTED") + # } + # } # option to filter on maximum confidence from GBIF search - one option only "single" # or allow list of options "any" diff --git a/R/name_search_powo.R b/R/name_search_powo.R index 0aa3665..9d32ab7 100644 --- a/R/name_search_powo.R +++ b/R/name_search_powo.R @@ -5,23 +5,21 @@ #' #' @param df (data frame) Taxon name(s) #' @param name_column (string) Column that contains the name(s) -#' @param powo_tax_stat (character) Default `any` provides all taxonomic -#' matches, otherwise `accepted` returns only accepted names according to POWO #' #' @return Returns a data frame with initial search term and matching name(s) #' @export -name_search_powo <- function(df, name_column, powo_tax_stat = "any"){ +name_search_powo <- function(df, name_column){ #name_df <- data.frame(name = name) results <- rWCVP::wcvp_match_names(names_df = df, name_col = name_column) - # allow user to filter on accepted name only - if (powo_tax_stat == "any"){ - results = results - } else { - if (powo_tax_stat == "accepted") { - results = dplyr::filter(results, wcvp_status == "Accepted") - }} + # # allow user to filter on accepted name only + # if (powo_tax_stat == "any"){ + # results = results + # } else { + # if (powo_tax_stat == "accepted") { + # results = dplyr::filter(results, wcvp_status == "Accepted") + # }} return(results) } diff --git a/R/sis_countries.R b/R/sis_countries.R index ea13e6e..d4b78de 100644 --- a/R/sis_countries.R +++ b/R/sis_countries.R @@ -1,40 +1,31 @@ #' Generate the countries.csv file #' -#' @param unique_id (character) Unique identifier -#' @param wcvp_ipni_id (character) WCVP identifier #' @param native_ranges (character) native range list of WGSRPD level 3 #' #' @return Returns an SIS compliant csv file #' @export +sis_countries <- function(native_ranges) { + country_table <- + dplyr::left_join(native_ranges, tdwg2iucn, by = c("LEVEL3_COD" = "Level.3.code")) -sis_countries <- function(unique_id, wcvp_ipni_id, native_ranges) { - combined_table <- purrr::map_dfr(seq_along(unique_id), function(i) { - unique_id <- unique_id[i] - wcvp_ipni_id <- wcvp_ipni_id[i] + country_table$CountryOccurrence.CountryOccurrenceSubfield.presence <- "Extant" + country_table$CountryOccurrence.CountryOccurrenceSubfield.origin <- "Native" + country_table$CountryOccurrence.CountryOccurrenceSubfield.seasonality <- "Resident" - native_ranges_filtered <- dplyr::filter(native_ranges, POWO_ID == wcvp_ipni_id) + country_table <- dplyr::select( + country_table, + internal_taxon_id, + countryoccurrence.countryoccurrencesubfield.countryoccurrencename, + CountryOccurrence.CountryOccurrenceSubfield.presence, + CountryOccurrence.CountryOccurrenceSubfield.origin, + CountryOccurrence.CountryOccurrenceSubfield.seasonality, + countryoccurrence.countryoccurrencesubfield.countryoccurrencelookup + ) - country_table <- dplyr::left_join(native_ranges_filtered, tdwg2iucn, by = c("LEVEL3_COD" = "Level.3.code")) + country_table <- + dplyr::distinct(country_table, .keep_all = TRUE) - country_table$CountryOccurrence.CountryOccurrenceSubfield.presence <- "Extant" - country_table$CountryOccurrence.CountryOccurrenceSubfield.origin <- "Native" - country_table$CountryOccurrence.CountryOccurrenceSubfield.seasonality <- "Resident" - country_table$internal_taxon_id <- unique_id - - country_table <- dplyr::select(country_table, - internal_taxon_id, - countryoccurrence.countryoccurrencesubfield.countryoccurrencename, - CountryOccurrence.CountryOccurrenceSubfield.presence, - CountryOccurrence.CountryOccurrenceSubfield.origin, - CountryOccurrence.CountryOccurrenceSubfield.seasonality, - countryoccurrence.countryoccurrencesubfield.countryoccurrencelookup) - - country_table <- dplyr::distinct(country_table, .keep_all = TRUE) - - return(country_table) - }) - - return(combined_table) + return(country_table) } diff --git a/R/sis_credits.R b/R/sis_credits.R index b2ceb93..d65575d 100644 --- a/R/sis_credits.R +++ b/R/sis_credits.R @@ -1,4 +1,5 @@ + #' Generate the credits.csv file #' #' @param unique_id (character) Unique identifier @@ -9,38 +10,23 @@ #' @return Returns an SIS compliant csv file #' @export -# sis_credits = function(unique_id, first_name="your first name",second_name = "your second name", -# email="your email", affiliation="your affiliation") { -# -# credits <- tibble::tibble( -# internal_taxon_id = unique_id, -# credit_type = "Assessor", -# firstName = first_name, -# lastName = second_name, -# initials = "", -# Order = "1", -# email = email, -# affiliation = affiliation, -# user_id = "1" -# ) -# -# return(credits) -# } - -sis_credits = function(unique_id, first_name="your first name",second_name = "your second name", - email="your email", affiliation="your affiliation") { +sis_credits = function(unique_id, + first_name = "your first name", + second_name = "your second name", + email = "your email", + affiliation = "your affiliation") { combined_table <- purrr::map_dfr(unique_id, function(id) { credits <- tibble::tibble( - internal_taxon_id = id, - credit_type = "Assessor", - firstName = first_name, - lastName = second_name, - initials = "", - Order = "1", - email = email, - affiliation = affiliation, - user_id = "1" + internal_taxon_id = id, + credit_type = "Assessor", + firstName = first_name, + lastName = second_name, + initials = "", + Order = "1", + email = email, + affiliation = affiliation, + user_id = "1" ) }) diff --git a/R/sis_references.R b/R/sis_references.R index 2ad920b..367eb3f 100644 --- a/R/sis_references.R +++ b/R/sis_references.R @@ -1,4 +1,5 @@ + #' Generate the references.csv file #' #' @param unique_id (character) Unique identifier. @@ -9,25 +10,26 @@ #' @export #' -sis_references = function(unique_id, gbif_ref = NULL, powo_ref = NULL) { - +sis_references = function(unique_id, + gbif_ref = NULL, + powo_ref = NULL) { LCr_ref <- - tibble::tibble( - Reference_type = "Assessment", - type = "electronic source", - author = "Bachman, S., Brown, M.", - year = format(as.Date(Sys.Date(), format="%d/%m/%Y"),"%Y"), - title = "LCr: Generate minimal Least Concern Red List assessments", - url = "https://github.com/stevenpbachman/LCr", - access_date = format(as.Date(Sys.Date(), format="%d/%m/%Y")) - ) + tibble::tibble( + Reference_type = "Assessment", + type = "electronic source", + author = "Bachman, S., Brown, M.", + year = format(as.Date(Sys.Date(), format = "%d/%m/%Y"), "%Y"), + title = "LCr: Generate minimal Least Concern Red List assessments", + url = "https://github.com/stevenpbachman/LCr", + access_date = format(as.Date(Sys.Date(), format = "%d/%m/%Y")) + ) sis_refs <- LCr_ref - if (powo_ref == TRUE) { - powo_ref <- powo_ref() - sis_refs <- dplyr::bind_rows(sis_refs, powo_ref) - } + if (powo_ref == TRUE) { + powo_ref <- powo_ref() + sis_refs <- dplyr::bind_rows(sis_refs, powo_ref) + } if (!is.null(gbif_ref)) { sis_refs <- dplyr::bind_rows(sis_refs, gbif_ref) } diff --git a/R/sis_taxonomy.R b/R/sis_taxonomy.R index 81dbf7f..8fef26b 100644 --- a/R/sis_taxonomy.R +++ b/R/sis_taxonomy.R @@ -2,6 +2,10 @@ #' Generate the taxonomy.csv file #' #' @param unique_id (character) Unique identifier. +#' @param family (character) field containing family. +#' @param genus (character) field containing genus. +#' @param species (character) field containing species. +#' @param taxonomicAuthority (character) field containing taxonomic author. #' #' @return Returns an SIS compliant csv file #' @export diff --git a/data/tdwg2iucn.rda b/data/tdwg2iucn.rda index fb202df..2e3da44 100644 Binary files a/data/tdwg2iucn.rda and b/data/tdwg2iucn.rda differ diff --git a/man/get_name_keys.Rd b/man/get_name_keys.Rd index 4a8bfcf..99c3cf5 100644 --- a/man/get_name_keys.Rd +++ b/man/get_name_keys.Rd @@ -4,19 +4,11 @@ \alias{get_name_keys} \title{Get accepted GBIF and POWO identifiers (keys) for taxon names to support data downloads} \usage{ -get_name_keys( - df, - name_column, - tax_status = "any", - match = "single", - kingdom = "plantae" -) +get_name_keys(df, name_column, match = "single", kingdom = "plantae") } \arguments{ \item{df}{character) Data frame with taxon names} -\item{tax_status}{(character) Default `any` provides all taxonomic, otherwise 'accepted'} - \item{match}{(character) Controls the output of the search. Use `single` to force a single match result that has the highest confidence or `any` to return all possible matches sorted in order of confidence} @@ -33,10 +25,10 @@ Returns a data frame with accepted GBIF and POWO identifiers Get accepted GBIF and POWO identifiers (keys) for taxon names to support data downloads } \details{ -Designed for batch processing. Default setting (tax_status = "accepted" and match = "single") -returns an accepted name with the best single match against GBIF and POWO name backbones. -Final list may return fewer names if there are discrepancies e.g. accepted +Designed for batch processing. Default setting (match = "single", kingdom = "plantae") +returns an accepted name with the best single match against GBIF and POWO name backbones (GBIF +only for kingdom = "fungi"). Final list may return fewer names if there are discrepancies e.g. accepted in GBIF, but not in POWO. Output data frame includes GBIF 'usageKey' that can be used with [`get_gbif_occs()`] to get occurrences from GBIF, and 'wcvp_ipni_id' that can be used with [`powo_range()`] -to get native ranges. To see a wider range of plausible matches adjust 'tax_status' and 'match' to 'any'. +to get native ranges. To see a wider range of plausible matches adjust 'match' to 'any'. } diff --git a/man/get_native_range.Rd b/man/get_native_range.Rd index 60e9714..9440038 100644 --- a/man/get_native_range.Rd +++ b/man/get_native_range.Rd @@ -7,10 +7,11 @@ get_native_range(keys) } \arguments{ -\item{keys}{(name_col) Column name for the identifier} +\item{keys}{(data frame) Contain identifier for the taxon e.g. derived from [`get_name_keys()`]} } \value{ -(data frame) A list of places where a taxon occurs. +(data frame) A list of 'botanical countries' (World Geogrpahic Scheme for Recording Plant +Distributions) where a taxon occurs. } \description{ Get native ranges for taxa diff --git a/man/get_occs_range.Rd b/man/get_occs_range.Rd index 27cc880..1c8fcf2 100644 --- a/man/get_occs_range.Rd +++ b/man/get_occs_range.Rd @@ -10,7 +10,7 @@ get_occs_range(sis_points) \item{sis_points}{(dataframe) SIS points file} } \value{ -Occurrence dataframe with ISO two-digit codes added +Occurrence dataframe with ISO two-digit codes added and internal id } \description{ Get ISO two-digit code from occurrence lat longs diff --git a/man/make_LC_points.Rd b/man/make_LC_points.Rd index f5d11b2..085c044 100644 --- a/man/make_LC_points.Rd +++ b/man/make_LC_points.Rd @@ -24,7 +24,7 @@ make_LC_points( \item{range_check}{(boolean) TRUE if you want to carry out occurrence cleaning with native range filter} } \value{ -(list) Includes the GBIF citation, and "points" the cleaned SIS compatible point file +(list) Includes the GBIF "citation", and "points" the cleaned SIS compatible point file } \description{ Combined function to get clean SIS points file using name identifiers diff --git a/man/make_sis_csvs.Rd b/man/make_sis_csvs.Rd index 0c07f7c..81e62d2 100644 --- a/man/make_sis_csvs.Rd +++ b/man/make_sis_csvs.Rd @@ -12,16 +12,18 @@ make_sis_csvs( email, institution, gbif_ref = NULL, - native_ranges, + powo_ref = FALSE, + native_ranges = NULL, family, genus, species, taxonomicAuthority, - kingdom = "plantae", - powo_ref = FALSE + kingdom = "plantae" ) } \arguments{ +\item{unique_id}{(character) Unique identifier - default is the GBIF usage key} + \item{first_name}{(character) First name of assessor} \item{second_name}{(character) Second name of assessor} @@ -32,11 +34,19 @@ make_sis_csvs( \item{gbif_ref}{(data frame) A GBIF download citation according to IUCN format.} +\item{powo_ref}{(data frame) A citation for use of POWO according to IUCN format.} + \item{native_ranges}{(data frame) Native ranges derived from [`get_native_range()`]} -\item{kingdom}{(character) Default is 'plantae', but can also be 'fungi'} +\item{family}{(character) Field containing the family} + +\item{genus}{(character) Field containing the genus} -\item{keys}{(data frame) Derived from [`get_name_keys()`] function. Must include at least GBIF_usageKey to obtain GBIF occurrences} +\item{species}{(character) Field containing the specific epithet} + +\item{taxonomicAuthority}{(character) Field containing the taxonomic authority} + +\item{kingdom}{(character) Default is 'plantae', but can also be 'fungi'} } \value{ Returns an SIS compliant zip file diff --git a/man/name_search_gbif.Rd b/man/name_search_gbif.Rd new file mode 100644 index 0000000..3e1d6e8 --- /dev/null +++ b/man/name_search_gbif.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/name_search_gbif.R +\name{name_search_gbif} +\alias{name_search_gbif} +\title{Query taxon name against GBIF backbone} +\usage{ +name_search_gbif(name, species_rank = TRUE, match = "single") +} +\arguments{ +\item{name}{(character) A taxon name} + +\item{species_rank}{(character) Default TRUE returns matches at species +level, otherwise FALSE returns any taxonomic rank} + +\item{match}{(character) Controls the output of the search. Use `single` to +force a single match result that has the highest confidence or `any` to return +all possible matches sorted in order of confidence} +} +\value{ +Returns a data frame with initial search term and matching name(s) +} +\description{ +Queries a taxon name against the GBIF names backbone. Simple wrapper around +the rgbif `name_backbone_verbose` function. +} +\examples{ +name_search_gbif("Poa annua L.") +} diff --git a/man/name_search_powo.Rd b/man/name_search_powo.Rd index fbd372a..ab02838 100644 --- a/man/name_search_powo.Rd +++ b/man/name_search_powo.Rd @@ -4,15 +4,12 @@ \alias{name_search_powo} \title{Query taxon name against POWO (Plants of the World Online) backbone} \usage{ -name_search_powo(df, name_column, powo_tax_stat = "any") +name_search_powo(df, name_column) } \arguments{ \item{df}{(data frame) Taxon name(s)} \item{name_column}{(string) Column that contains the name(s)} - -\item{powo_tax_stat}{(character) Default `any` provides all taxonomic -matches, otherwise `accepted` returns only accepted names according to POWO} } \value{ Returns a data frame with initial search term and matching name(s) diff --git a/man/sis_countries.Rd b/man/sis_countries.Rd index 3cccdf2..e313157 100644 --- a/man/sis_countries.Rd +++ b/man/sis_countries.Rd @@ -4,13 +4,9 @@ \alias{sis_countries} \title{Generate the countries.csv file} \usage{ -sis_countries(unique_id, wcvp_ipni_id, native_ranges) +sis_countries(native_ranges) } \arguments{ -\item{unique_id}{(character) Unique identifier} - -\item{wcvp_ipni_id}{(character) WCVP identifier} - \item{native_ranges}{(character) native range list of WGSRPD level 3} } \value{ diff --git a/man/sis_taxonomy.Rd b/man/sis_taxonomy.Rd index 0c4eb48..03a19e4 100644 --- a/man/sis_taxonomy.Rd +++ b/man/sis_taxonomy.Rd @@ -8,6 +8,14 @@ sis_taxonomy(unique_id, family, genus, species, taxonomicAuthority) } \arguments{ \item{unique_id}{(character) Unique identifier.} + +\item{family}{(character) field containing family.} + +\item{genus}{(character) field containing genus.} + +\item{species}{(character) field containing species.} + +\item{taxonomicAuthority}{(character) field containing taxonomic author.} } \value{ Returns an SIS compliant csv file