Skip to content

Commit

Permalink
use tempfile in gnr_resolve, bumped 99
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Jun 29, 2015
1 parent 57e25e4 commit fee1aa9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Description: Taxonomic information from around the web. This package
interacts with a suite of web 'APIs' for taxonomic tasks, such
as verifying species names, getting taxonomic hierarchies,
and verifying name spelling.
Version: 0.6.0.9960
Version: 0.6.0.9961
License: MIT + file LICENSE
URL: https://github.com/ropensci/taxize
BugReports: https://github.com/ropensci/taxize/issues
Expand Down
5 changes: 3 additions & 2 deletions R/gnr_resolve.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ gnr_resolve <- function(names, data_source_ids = NULL, resolve_once = FALSE,
for (i in seq_along(nms)) {
tt <- data.frame(num = 1:length(nms[[i]]), names = nms[[i]])
tt <- data.frame(ddply(tt, .(num), summarise, paste0(num, "|", names))[,2])
write.table(tt, file = "~/gnr_names.txt", row.names = FALSE, col.names = FALSE, quote = FALSE)
ss <- POST(url, query = args, body = list(file = upload_file(path = "~/gnr_names.txt")), ...)
file <- tempfile(fileext = ".txt")
write.table(tt, file = file, row.names = FALSE, col.names = FALSE, quote = FALSE)
ss <- POST(url, query = args, body = list(file = upload_file(path = file)), ...)
warn_for_status(ss)
ss <- content(ss, "text")
datbits[[i]] <- jsonlite::fromJSON(ss, FALSE)$data
Expand Down

0 comments on commit fee1aa9

Please sign in to comment.