This file contains hidden or 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
process_data_chrom <- function(file, min.depth = 2, max.depth.quantile.prob = 0.9, | |
error = 0.01, trunc = c(0,0), chrom){ | |
df <- data.table::fread(file, sep = "\t") | |
if(ncol(df) != 7){ | |
message("Did you run `prepare_data()` on this file? Your data is in the wrong format, please correct and try again.") | |
} else{ | |
df <- df[which(df$chr == chrom), 3:7] | |
df <- stats::na.omit(df) | |
dfm <- as.matrix(df) | |
This file contains hidden or 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
# R example | |
# Load packages | |
library(rgbif) | |
# Download Option #1 - based on scientificName | |
gbif_data <- occ_data(scientificName = "Cryptantha pterocarya var. purpusii") | |
## Now look at verbatim record | |
gbif_data$data$key <- as.numeric(gbif_data$data$key) | |
query_gbif <- rgbif::occ_get_verbatim(key = gbif_data$data$key, fields = c("scientificName"), curlopts=list(http_version=2)) |
This file contains hidden or 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
collector_clean <- function(df, collector.list = NA, collector.field = "recordedBy"){ | |
if (NROW(df) == 0) return(df) | |
if(any(is.na(collector.list)) | length(collector.list) == 0){ | |
record.filter <- "interactive" | |
} else{ | |
record.filter <- "list-based" | |
} | |
if (record.filter == "interactive" ) { |
This file contains hidden or 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
# Load packages | |
library(ridigbio) | |
library(gatoRs) | |
# Download for Galax | |
sout <- idig_search(rq =list(scientificname = "Galax urceolata")) # exact match | |
rout <- idig_search(rq = list("data" = list("type" = "fulltext","value" = "Galax urceolata"))) # searches all data fields strings for a partial match | |
bestout <- gatoRs::gators_download(synonyms.list = "Galax urceolata") # searches like above, then applies pseduo-fuzzy match | |
# Look at the taxa |
This file contains hidden or 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
a<- read.csv2("SupplementalInformation_FinalOccurrenceRecords.csv",sep=',') | |
b <- list() | |
for(1:length(a)){ | |
b[i] <- gbif_citation(a$key[i])$citation$text | |
} |
This file contains hidden or 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
try <- idig_search_records(rq = list("data.dwc:dynamicProperties" = list("Mrs", "Ms", "Miss"))) | |
# Might be better to try | |
idig_search_records(rq=list('data'=list('type'='fulltext','value'='alligator'))) |