├── .gitignore ├── NAMESPACE ├── R ├── ospkgs.R ├── ro_key_check.R ├── ro_search.r ├── ro_sources.r └── ropensci_helpers.R ├── README-NOT.md ├── README.md └── data └── rosources.rda /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .Rhistory 3 | R/testing.R -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | export(rosources) 2 | import(RCurl) 3 | import(RJSONIO) 4 | import(ggplot2) 5 | import(stringr) 6 | import(rplos) 7 | import(rmendeley) -------------------------------------------------------------------------------- /R/ospkgs.R: -------------------------------------------------------------------------------- 1 | # FOR NOW, I just source the functions commented below here and then use ospkgs 2 | # source("/Users/ScottMac/treeBASE/R/treebase.R") 3 | # source("/Users/ScottMac/rbhl/R/namesearch.R") 4 | # source("/Users/ScottMac/rplos/R/searchplos.R") 5 | # source("/Users/ScottMac/rgbif/R/taxoncount.R") 6 | # source("/Users/ScottMac/rbold/R/getsampleids.R") 7 | 8 | # ospkgs.R 9 | 10 | ospkgs <- function(species = NA) 11 | # Args: 12 | # species: species name (character) 13 | # Examples: 14 | # ospkgs(species = "Andrena") 15 | { 16 | treeBASE_out <- suppressMessages( 17 | search_treebase(paste('"', species, '"', sep = ""), by="taxon")) 18 | rplos_out <- searchplos(species, 'everything', 999) 19 | rgbif_out <- taxoncount(species) 20 | rbhl_out <- namesearch(species, "json") 21 | rbold_out <- getsampleids(species) 22 | outlist <- list(treeBASE = c(length(treeBASE_out), "phylotrees")) 23 | outlist$rplos <- c(as.numeric(rplos_out[[1]]), "papers") 24 | outlist$rgbif <- c(rgbif_out, "records") 25 | outlist$rbhl <- c(length(rbhl_out[,2]), "records") 26 | outlist$rbold <- c(length(rbold_out), "records") 27 | df <- ldply(outlist) 28 | names(df) <- c("Package", "Number", "Datatype") 29 | return(df) 30 | } -------------------------------------------------------------------------------- /R/ro_key_check.R: -------------------------------------------------------------------------------- 1 | #' Checks for missing API keys 2 | #' 3 | #'@param key 4 | #'@param error_types 5 | #'@keywords 6 | #'@seealso 7 | #'@return 8 | #'@alias 9 | #'@export 10 | #'@examples \dontrun{ 11 | #' 12 | #'} 13 | ropensci_key<-function(key = NULL) 14 | { 15 | if(is.null(key)) { 16 | stop("You need to specify a key to look for", call.=FALSE) 17 | } 18 | x <- try(getOption(key),silent=T) 19 | if(is.null(x)) 20 | { 21 | message <- paste("Missing API key for package",key,"\n","?ropensci_key for more information on storing keys") 22 | stop(message) 23 | } 24 | invisible() 25 | } -------------------------------------------------------------------------------- /R/ro_search.r: -------------------------------------------------------------------------------- 1 | #'A simple search across existing packages 2 | #' 3 | #' 4 | #'@param query = NULL 5 | #'@keywords 6 | #'@seealso 7 | #'@return 8 | #'@alias 9 | #'@export 10 | #'@examples \dontrun{ 11 | #' 12 | #'} 13 | ro_search <- function(query = NULL) { 14 | if(!is.null(query)) { 15 | stop("You did not include a query term", call.= FALSE) 16 | } 17 | # source_list=ro_sources() 18 | # # load packages 19 | # search rPLOS 20 | # search RMendeley 21 | # search rDryad (tricky because there is no API based search method) 22 | # concat the results and return it. 23 | } -------------------------------------------------------------------------------- /R/ro_sources.r: -------------------------------------------------------------------------------- 1 | #'Package to list current ropensci sources 2 | #' 3 | #'@param sources Reads data stored in data folder 4 | #'@param verbose = TRUE Default is complete listing 5 | #'@keywords 6 | #'@seealso 7 | #'@return data frame 8 | #'@alias 9 | #'@export 10 | #'@examples \dontrun{ 11 | #' 12 | #'} 13 | ro_sources <- function(sources='..data/rosources.rda', verbose = TRUE, working = NULL) { 14 | load(sources) 15 | if(!is.null(working)) { 16 | sources = subset(sources, working == TRUE) 17 | } 18 | return(rosources) 19 | } 20 | 21 | # Generating package data 22 | # data_source = c("Dryad", "Mendeley", "PLOS") 23 | # package_name = c("rDryad", "RMendeley", "rPLOS") 24 | # working = c(TRUE, TRUE, TRUE) 25 | # sources=data.frame(data_source, package_name, working) 26 | # save(sources, file="../data/rosources.rda") 27 | -------------------------------------------------------------------------------- /R/ropensci_helpers.R: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ropensci-archive/rOpenSci/3fbd5fe80ee885fa9d7c39d732c34afa57a1c86d/R/ropensci_helpers.R -------------------------------------------------------------------------------- /README-NOT.md: -------------------------------------------------------------------------------- 1 | # rOpenSci 2 | 3 | [![Project Status: Abandoned](https://www.repostatus.org/badges/latest/abandoned.svg)](https://www.repostatus.org/#abandoned) 4 | 5 | This package has been archived. The former README is now in [README-NOT.md](README-NOT.md). 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rOpenSci 2 | 3 | [![Project Status: Abandoned](https://www.repostatus.org/badges/latest/abandoned.svg)](https://www.repostatus.org/#abandoned) 4 | 5 | This repository has been archived. The former README is now in [README-NOT.md](README-NOT.md). 6 | -------------------------------------------------------------------------------- /data/rosources.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ropensci-archive/rOpenSci/3fbd5fe80ee885fa9d7c39d732c34afa57a1c86d/data/rosources.rda --------------------------------------------------------------------------------