Skip to content

Commit

Permalink
fix #98, namespace base pkg fxn calls
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Sep 22, 2017
1 parent abaa140 commit dddacba
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 17 deletions.
5 changes: 1 addition & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Description: Species trait data from many different sources, including
data from the Global Invasive Species Database and 'EOL', 'Traitbank' data
from 'EOL', Coral traits data from http://coraltraits.org, 'nativity' status
('Flora Europaea' or 'ITIS'), and 'Birdlife' International.
Version: 0.2.0.9418
Version: 0.2.3.9100
Authors@R: c(
person("Scott", "Chamberlain", role = c("aut", "cre"), email = "myrmecocystus@gmail.com"),
person("Zachary", "Foster", role = "aut", email = "zacharyfoster1989@gmail.com"),
Expand All @@ -21,9 +21,6 @@ VignetteBuilder: knitr
Depends:
R (>= 2.10)
Imports:
methods,
stats,
utils,
jsonlite (>= 0.9.19),
httr (>= 1.1.0),
dplyr (>= 0.4.3),
Expand Down
5 changes: 0 additions & 5 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,13 @@ importFrom(httr,content)
importFrom(httr,stop_for_status)
importFrom(httr,warn_for_status)
importFrom(jsonlite,fromJSON)
importFrom(methods,is)
importFrom(readr,read_delim)
importFrom(rvest,html_table)
importFrom(stats,na.omit)
importFrom(stats,setNames)
importFrom(taxize,classification)
importFrom(taxize,get_tsn)
importFrom(taxize,get_uid)
importFrom(taxize,itis_native)
importFrom(taxize,iucn_id)
importFrom(utils,URLencode)
importFrom(utils,read.csv)
importFrom(xml2,read_xml)
importFrom(xml2,xml_find_all)
importFrom(xml2,xml_text)
2 changes: 1 addition & 1 deletion R/coral.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ coral_GET <- function(url, args, ...) {
res <- GET(url, query = args, ...)
stop_for_status(res)
txt <- content(res, "text", encoding = "UTF-8")
dplyr::tbl_df(read.csv(text = txt, header = TRUE, stringsAsFactors = FALSE))
dplyr::tbl_df(utils::read.csv(text = txt, header = TRUE, stringsAsFactors = FALSE))
}

coralbase <- function() 'http://coraltraits.org'
Expand Down
2 changes: 1 addition & 1 deletion R/eol_invasive.R
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,5 @@ eol_invasive_ <- function(name = NULL, dataset="all", searchby = grep, page=NULL
df$db <- dataset
names(df)[c(1,3)] <- c("searched_name","eol_object_id")
row.names(df) <- NULL
if (!count) df else length(na.omit(df$eol_object_id))
if (!count) df else length(stats::na.omit(df$eol_object_id))
}
2 changes: 1 addition & 1 deletion R/g_invasive.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ g_invasive <- function(x, simplify = FALSE, verbose=TRUE) {
one <- tryCatch(xml2::xml_text(xml2::xml_find_all(doc, "//span[@class='ListNote']"))[[1]],
error = function(e) e)
two <- paste(xml2::xml_text(xml2::xml_find_all(doc, "//span[@class='Info']")), collapse = "; ")
out[i, 2] <- paste(if (is(one, "simpleError")) NULL else one, two, sep = "; ")
out[i, 2] <- paste(if (inherits(one, "simpleError")) NULL else one, two, sep = "; ")
} else {
out[i, 2] <- "Invasive"
}
Expand Down
2 changes: 1 addition & 1 deletion R/leda.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#' sapply(out, NROW)
#' }
leda <- function(trait = "age_first_flowering", ...) {
tt <- GET(URLencode(paste0(leda_base(), pick_file_name(trait))), ...)
tt <- GET(utils::URLencode(paste0(leda_base(), pick_file_name(trait))), ...)
out <- rawToChar(content(tt, "raw", encoding = "UTF-8"))
stop_for_status(tt)
out <- iconv(out, "latin1", "UTF-8")
Expand Down
3 changes: 0 additions & 3 deletions R/traits-package.r
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
#'
#' @importFrom httr GET POST content stop_for_status warn_for_status authenticate
#' @importFrom jsonlite fromJSON
#' @importFrom methods is
#' @importFrom stats setNames na.omit
#' @importFrom utils read.csv URLencode
#' @importFrom xml2 read_xml xml_find_all xml_text
#' @importFrom rvest html_table
#' @importFrom taxize get_uid classification get_tsn itis_native iucn_id
Expand Down
2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ trydefault <- function (expr, default, quiet = FALSE){
}

low_names <- function(x) {
if (is(x, "data.frame")) {
if (inherits(x, "data.frame")) {
stats::setNames(x, tolower(names(x)))
} else {
x
Expand Down

0 comments on commit dddacba

Please sign in to comment.