Skip to content

Commit

Permalink
fix #155 - fix to argo functions for the file param and box input
Browse files Browse the repository at this point in the history
removed Remotes install of geojsonio
need to import scale_x_date from ggplot2
removed commented out code form ncdc_plot
  • Loading branch information
sckott committed May 4, 2016
1 parent d0009f6 commit d9b6aea
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 32 deletions.
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Description: Client for many 'NOAA' data sources including the 'NCDC' climate
for 'NOAA' sea ice data, the 'NOAA' severe weather inventory, 'NOAA' Historical
Observing 'Metadata' Repository ('HOMR') data, 'NOAA' storm data via 'IBTrACS',
tornado data via the 'NOAA' storm prediction center, and more.
Version: 0.5.2.9998
Version: 0.5.5.9000
License: MIT + file LICENSE
Authors@R: c(
person("Scott", "Chamberlain", role = c("aut","cre"), email = "myrmecocystus@gmail.com"),
Expand Down Expand Up @@ -44,5 +44,4 @@ Suggests:
lawn,
rgdal,
covr
Remotes: ropensci/geojsonio
RoxygenNote: 5.0.1
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ importFrom(ggplot2,ggplot)
importFrom(ggplot2,guide_legend)
importFrom(ggplot2,guides)
importFrom(ggplot2,labs)
importFrom(ggplot2,scale_x_datetime)
importFrom(ggplot2,scale_x_date)
importFrom(ggplot2,theme)
importFrom(ggplot2,theme_bw)
importFrom(httr,GET)
Expand Down
5 changes: 3 additions & 2 deletions R/argo.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ argo_search <- function(func = NULL, of = NULL, qwmo = NULL, wmo = NULL, box=NUL
pres_qc = NULL, temp_qc = NULL, psal_qc = NULL, doxy_qc = NULL,
ticket = NULL, limit = 10, ...) {

args <- noaa_compact(list(get = func, of = of, qwmo = qwmo, wmo = wmo, file = file,
if (!is.null(box)) box <- paste0(box, collapse = ",")
args <- noaa_compact(list(get = func, of = of, qwmo = qwmo, wmo = wmo,
box = box, area = area, around = around, year = year, yearmin = yearmin,
yearmax = yearmax, month = month, monthmin = monthmin, monthmax = monthmax,
lr = lr, from = from, to = to, dmode = dmode, pres_qc = pres_qc, temp_qc = temp_qc,
psal_qc = psal_qc, doxy_qc = doxy_qc, ticket = ticket, limit = limit))
res <- argo_GET(argo_api(), args, ...)
res <- argo_GET(url = argo_api(), args, ...)
jsonlite::fromJSON(utcf8(res))
}

Expand Down
8 changes: 4 additions & 4 deletions R/ncdc_plot.r
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
#'
#' @export
#' @param ... Input noaa object or objects.
#' @param breaks Regularly spaced date breaks for x-axis. See examples for usage.
#' See \code{\link{date_breaks}}. Default: \code{NULL} (uses ggplot2 default break
#' @param breaks Regularly spaced date breaks for x-axis. See examples for usage.
#' See \code{\link{date_breaks}}. Default: \code{NULL} (uses ggplot2 default break
#' sformatting)
#' @param dateformat Date format using standard POSIX specification for labels on
#' x-axis. See \code{\link{date_format}}
#' @return ggplot2 plot
#' @details
#' This function accepts directly output from the \code{\link[rnoaa]{ncdc}} function,
#' not other functions.
#'
#'
#' This is a simple wrapper function around some ggplot2 code. There is indeed a lot you
#' can modify in your plots, so this function just does some basic stuff. Look at the internals
#' for what the function does.
Expand Down Expand Up @@ -81,7 +81,7 @@ plot_template <- function(df, breaks, dateformat) {
)
if (!is.null(breaks)) {
c(tt, scale_x_date(date_breaks = breaks, date_labels = dateformat))
#c(tt, scale_x_datetime(breaks = date_breaks(breaks), labels = date_format(dateformat)))

} else {
tt
}
Expand Down
8 changes: 8 additions & 0 deletions R/ncdc_stations.r
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
#'
#' # Get metadata on a single station
#' ncdc_stations(stationid='COOP:010008')
#'
#' # For many stations use lapply or similar
#' lapply(c("COOP:010008", "COOP:010063", "COOP:010116"), function(z) {
#' ncdc_stations(
#' startdate = "2013-01-01",
#' enddate = "2014-11-01",
#' stationid = z)
#' }$data)
#'
#' # Displays all stations within GHCN-Daily (100 Stations per page limit)
#' ncdc_stations(datasetid='GHCND')
Expand Down
28 changes: 14 additions & 14 deletions R/rnoaa-package.r
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#' @title rnoaa
#'
#'
#' @description rnoaa is an R interface to NOAA climate data.
#'
#' @section Data Sources:
#' Many functions in this package interact with the National Climatic Data
#' Center application programming interface (API) at
#' @section Data Sources:
#' Many functions in this package interact with the National Climatic Data
#' Center application programming interface (API) at
#' http://www.ncdc.noaa.gov/cdo-web/webservices/v2, all of
#' which functions start with \code{ncdc_}. An access token, or API key, is required to use all
#' the \code{ncdc_} functions. The key is required by NOAA, not us. Go to the link given above
#' the \code{ncdc_} functions. The key is required by NOAA, not us. Go to the link given above
#' to get an API key.
#'
#' More NOAA data sources are being added through time. Data sources and their
#' More NOAA data sources are being added through time. Data sources and their
#' function prefixes are:
#'
#' \itemize{
Expand All @@ -27,23 +27,23 @@
#' \item \code{argo_*} - Argo buoys
#' \item \code{coops_search} - NOAA CO-OPS - tides and currents data
#' }
#'
#'
#' @section A note about NCDF data:
#'
#'
#' Functions to work with buoy data use netcdf files. You'll need the \code{ncdf4}
#' package for those functions, and those only. \code{ncdf4} is in Suggests in
#' this package, meaning you only need \code{ncdf4} if you are using the buoy
#' package for those functions, and those only. \code{ncdf4} is in Suggests in
#' this package, meaning you only need \code{ncdf4} if you are using the buoy
#' functions. You'll get an informative error telling you to install \code{ncdf4}
#' if you don't have it and you try to use the buoy functions.
#'
#'
#' @importFrom methods is
#' @importFrom stats var setNames complete.cases
#' @importFrom utils head download.file read.csv read.delim read.fwf read.table
#' @importFrom utils head download.file read.csv read.delim read.fwf read.table
#' write.csv untar unzip
#' @importFrom lubridate ymd year today month
#' @importFrom scales date_breaks date_format
#' @importFrom ggplot2 ggplot aes facet_wrap theme theme_bw geom_line labs
#' guides guide_legend fortify scale_x_datetime element_blank
#' @importFrom ggplot2 ggplot aes facet_wrap theme theme_bw geom_line labs
#' guides guide_legend fortify scale_x_date element_blank
#' @importFrom httr GET add_headers content warn_for_status stop_for_status
#' write_disk parse_url build_url http_status
#' @importFrom XML xpathSApply xpathApply xmlValue xmlParse xmlToList htmlParse
Expand Down
4 changes: 2 additions & 2 deletions man/ncdc_plot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions man/ncdc_stations.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions man/rnoaa-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d9b6aea

Please sign in to comment.