Commit 4d10938f authored by Laura A DeCicco's avatar Laura A DeCicco
Browse files

Getting rid of mutate and select

parent d767d96b
Package: dataRetrieval
Type: Package
Title: Retrieval Functions for USGS and EPA Hydrologic and Water Quality Data
Version: 2.7.4.9000
Version: 2.7.4.9001
Authors@R: c(
person("Laura", "DeCicco", role = c("aut","cre"),
email = "ldecicco@usgs.gov",
......
......@@ -46,12 +46,6 @@ export(whatWQPsites)
export(zeroPad)
import(stats)
import(utils)
importFrom(dplyr,everything)
importFrom(dplyr,mutate)
importFrom(dplyr,mutate_)
importFrom(dplyr,mutate_each_)
importFrom(dplyr,select)
importFrom(dplyr,select_)
importFrom(readr,col_character)
importFrom(readr,col_number)
importFrom(readr,cols)
......
dataRetrieval 2.7.5
==========
* Fixed some time zone joining bugs that were happening if the timezone column had no information in the first ~100 returned rows.
* Changed WQP default behavior to a zip return
* Changed WQP default behavior to a POST instead of GET.
* Remove mutate_, select_ functions
dataRetrieval 2.7.3
==========
* Reworked whatNWISdata to allow the full flexibility of `...`
......
......@@ -14,8 +14,6 @@
#' `ActivityEndDateWY`.
#' @export
#'
#' @importFrom dplyr select
#' @importFrom dplyr everything
#' @examples
#' \donttest{
#' dataTemp <- readNWISdata(stateCd="OH",parameterCd="00010", service="dv")
......@@ -50,7 +48,8 @@ addWaterYear <- function(rawData){
# move waterYear so that it is always comes right after dateTime
dateCol_i <- which(names(rawData) == dateCol)
dateColWY_i <- which(names(rawData) == dateColWY)
rawData <- select(rawData, 1:dateCol_i, dateColWY_i, everything())
everything_else <- which(!(names(rawData) %in% c(dateCol,dateColWY)))
rawData <- rawData[, c(1:dateCol_i, dateColWY_i, everything_else)]
}
return(rawData)
......
......@@ -111,7 +111,8 @@ importNGWMN <- function(input, asDateTime=FALSE, tz="UTC"){
names(siteLocs) <- c("dec_lat_va", "dec_lon_va")
dec_lat_va <- "dplyr var"
dec_lon_va <- "dplyr var"
siteLocs <- mutate(siteLocs, dec_lat_va=as.numeric(dec_lat_va), dec_lon_va=as.numeric(dec_lon_va))
siteLocs$dec_lat_va <- as.numeric(siteLocs$dec_lat_va)
siteLocs$dec_lon_va <- as.numeric(siteLocs$dec_lon_va)
mergedDF <- cbind.data.frame(site, description = siteDesc, siteLocs, stringsAsFactors = FALSE)
} else if (response == "ExceptionReport"){
......@@ -135,7 +136,6 @@ importNGWMN <- function(input, asDateTime=FALSE, tz="UTC"){
#' Possible values are "America/New_York","America/Chicago", "America/Denver","America/Los_Angeles",
#' "America/Anchorage","America/Honolulu","America/Jamaica","America/Managua","America/Phoenix", and "America/Metlakatla"
#' @importFrom xml2 xml_attr xml_find_all xml_text
#' @importFrom dplyr mutate
#' @export
#' @examples
#' baseURL <- "https://waterservices.usgs.gov/nwis/dv/?format=waterml,2.0"
......@@ -174,12 +174,13 @@ importWaterML2 <- function(input, asDateTime=FALSE, tz="UTC") {
splitTime <- data.frame(matrix(unlist(strsplit(rawTime, "T")), nrow=nVals, byrow = TRUE), stringsAsFactors=FALSE)
if(ncol(splitTime) > 1){ #some sites only have a date
names(splitTime) <- c("date", "time")
}else{
} else {
names(splitTime) <- "date"
splitTime <- mutate(splitTime, time = NA)
splitTime$time <- NA
}
timeDF <- mutate(splitTime, dateTime = NA)
timeDF <- splitTime
timeDF$dateTime <- NA
logicVec <- nchar(rawTime) > 19
if(!all(!logicVec)) { #otherwise sets it to char <NA>
timeDF$dateTime[logicVec] <- rawTime[logicVec]
......
......@@ -12,7 +12,6 @@
#' "America/Jamaica","America/Managua","America/Phoenix", and "America/Metlakatla". See also \code{OlsonNames()}
#' for more information on time zones.
#' @import utils
#' @importFrom dplyr mutate
#' @export
#' @examples
#' \donttest{
......@@ -185,7 +184,7 @@ retrieveObservation <- function(featureID, asDateTime, attrs, tz){
if(nrow(returnData) > 0){
#tack on site number
siteNum <- rep(sub('.*\\.', '', featureID), nrow(returnData))
returnData <- mutate(returnData, site = siteNum)
returnData$site <- siteNum
numCol <- ncol(returnData)
returnData <- returnData[,c(numCol,1:(numCol - 1))] #move siteNum to the left
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment