Skip to content

Commit

Permalink
version 0.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcarslaw authored and cran-robot committed Sep 17, 2020
1 parent 92cf80e commit 05dae45
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 29 deletions.
16 changes: 8 additions & 8 deletions DESCRIPTION
Expand Up @@ -2,27 +2,27 @@ Package: worldmet
Type: Package
Title: Import Surface Meteorological Data from NOAA Integrated Surface
Database (ISD)
Version: 0.9.0
Date: 2020-07-04
Version: 0.9.2
Date: 2020-09-16
Authors@R: c(person("David", "Carslaw", role = c("aut", "cre"), email =
"david.carslaw@york.ac.uk"))
ByteCompile: true
Depends: R (>= 3.2.0)
Imports: openair, doParallel, parallel, foreach, dplyr, leaflet, tidyr,
readr, zoo
Imports: openair, doParallel, parallel, foreach, purrr, dplyr, leaflet,
tidyr, readr, zoo
Maintainer: David Carslaw <david.carslaw@york.ac.uk>
Description: Functions to import data from more than 30,000 surface
meteorological sites around the world managed by the National Oceanic and Atmospheric Administration (NOAA) Integrated Surface
Database (ISD, see <https://www.ncdc.noaa.gov/isd>).
License: GPL (>= 2)
URL: http://github.com/davidcarslaw/worldmet
BugReports: http://github.com/davidcarslaw/worldmet/issues
URL: https://github.com/davidcarslaw/worldmet
BugReports: https://github.com/davidcarslaw/worldmet/issues
LazyLoad: true
LazyData: true
Encoding: UTF-8
RoxygenNote: 7.1.1
NeedsCompilation: no
Packaged: 2020-07-06 07:32:20 UTC; davidcarslaw
Packaged: 2020-09-17 08:07:55 UTC; davidcarslaw
Author: David Carslaw [aut, cre]
Repository: CRAN
Date/Publication: 2020-07-06 08:00:02 UTC
Date/Publication: 2020-09-17 09:20:03 UTC
18 changes: 9 additions & 9 deletions MD5
@@ -1,18 +1,18 @@
3a9b12555483162191f997e29ae45b5c *DESCRIPTION
5554126115cffe504a26e154581f8a42 *NAMESPACE
dfe77d899ba5964a17143dd2f0f20716 *R/exportADMS.R
80b830c7f42cae93aabde6ea76fdd0a5 *R/getMeta.R
6b9ab4005f5bd9cd208f50f8b92b208a *R/metNOAA.R
bd3c85c6173ee4a9946d9116678cdc0c *DESCRIPTION
87653d0a1140b9fb3baf91dd36b916d4 *NAMESPACE
209890816c1164a6006eee65a414d50f *R/exportADMS.R
6824da4b0ea1cd6f2d402df041aacf40 *R/getMeta.R
8246e718057230db50c364e25c4e81a4 *R/metNOAA.R
51fe6a661b7819c2f5f26c278f121f89 *R/sysdata.rda
dfd79efabee5ea65b0ee279b9f8330de *R/weatherCodes.R
97f08f4288246821805256f22b5abe76 *R/worldmet-package.R
4e12ca3ac9d10c32df1323a551b5a349 *R/worldmet-package.R
a291ee7e00be29c4f65063d8b843aa10 *R/zzz.R
8df567a5cf8efae68c0385d8b205a71b *README.md
433e10394fca0105f8e9fedd7a3ad7b5 *README.md
8699a0e8e38705634dd0ae8f861ea0c4 *data/weatherCodes.rda
84f21841c2bbb1c09c3ffbcf11ec2145 *inst/images/map.PNG
ca62b4153959d89af26f07cc4e2e1d32 *man/exportADMS.Rd
93336f281eb907d084235732006103ef *man/getMeta.Rd
40c9a88ccb100f7fc94a4e3899406085 *man/getMetaLive.Rd
de547484e4250c05837511c15f565baf *man/importNOAA.Rd
29eba6961eaba8e6dd9ccb4164e3f806 *man/importNOAA.Rd
033635944e83ba6b778f20d6c189adb2 *man/weatherCodes.Rd
400eff081bb3b030b80d6d176df554b0 *man/worldmet.Rd
d6e63d90736fe654c729d3de8de3bdd3 *man/worldmet.Rd
2 changes: 2 additions & 0 deletions NAMESPACE
Expand Up @@ -11,11 +11,13 @@ import(openair)
import(parallel)
import(readr)
import(tidyr)
importFrom(dplyr,`%>%`)
importFrom(leaflet,addCircles)
importFrom(leaflet,addMarkers)
importFrom(leaflet,addTiles)
importFrom(leaflet,leaflet)
importFrom(leaflet,markerClusterOptions)
importFrom(purrr,pmap_dfr)
importFrom(utils,download.file)
importFrom(utils,head)
importFrom(utils,write.table)
Expand Down
4 changes: 4 additions & 0 deletions R/exportADMS.R
Expand Up @@ -75,6 +75,10 @@ exportADMS <- function(dat, out = "./ADMS_met.MET", interp = FALSE, maxgap = 2)
day <- as.numeric(format(dat$date, "%j"))
hour <- as.numeric(format(dat$date, "%H"))
station <- "0000"

# check if present
if (!"cl" %in% names(dat)) dat$cl <- NA
if (!"precip" %in% names(dat)) dat$precip <- NA

## data frame of met data needed
adms <- data.frame(station, year, day, hour,
Expand Down
5 changes: 3 additions & 2 deletions R/getMeta.R
Expand Up @@ -39,6 +39,7 @@
##' are made an approximate distance, \code{dist} in km is also
##' returned.
##' @export
##' @importFrom dplyr `%>%`
##' @author David Carslaw
##' @examples
##'
Expand Down Expand Up @@ -148,8 +149,8 @@ getMeta <- function(site = "heathrow", lat = NA, lon = NA,
stroke = TRUE, color = "red",
popup = paste(
"Search location",
paste("Lat =", latitude),
paste("Lon =", longitude),
paste("Lat =", dat$latitude),
paste("Lon =", dat$longitude),
sep = "<br/>"
)
)
Expand Down
13 changes: 7 additions & 6 deletions R/metNOAA.R
Expand Up @@ -4,7 +4,7 @@
##' Database (ISD). The ISD contains detailed surface meteorological data from
##' around the world for over 30,000 locations. For general information of the
##' ISD see \url{https://www.ncdc.noaa.gov/isd} and the map here
##' \url{https://gis.ncdc.noaa.gov/map/viewer/#app=cdo&cfg=cdo&theme=hourly&layers=1}.
##' \url{https://gis.ncdc.noaa.gov/maps/ncei}.
##'
##' Note the following units for the main variables:
##'
Expand Down Expand Up @@ -89,9 +89,11 @@
##' @import readr
##' @import tidyr
##' @import doParallel parallel foreach dplyr
##' @importFrom purrr pmap_dfr
##' @importFrom utils head write.table download.file
##' @importFrom leaflet addCircles addMarkers addTiles leaflet
##' markerClusterOptions
##' @importFrom dplyr `%>%`
##' @return Returns a data frame of surface observations. The data frame is
##' consistent for use with the \code{openair} package. NOTE! the data are
##' returned in GMT (UTC) time zone format. Users may wish to express the data
Expand Down Expand Up @@ -146,10 +148,9 @@ importNOAA <- function(code = "037720-99999", year = 2014,

stopCluster(cl)
} else {
dat <- rowwise(site_process) %>%
summarise(getDat(
year = .data$year, code = .data$code, hourly = hourly
))

dat <- pmap_dfr(site_process, getDat, hourly = hourly)

}

if (is.null(dat)) {
Expand Down Expand Up @@ -432,7 +433,7 @@ getDat <- function(code, year, hourly) {
sep = ",", fill = "right"
)

dat <- left_join(dat, weatherCodes, by = "pwc")
dat <- left_join(dat, worldmet::weatherCodes, by = "pwc")
dat <- select(dat, -pwc) %>%
rename(pwc = description)
}
Expand Down
2 changes: 1 addition & 1 deletion R/worldmet-package.R
Expand Up @@ -16,7 +16,7 @@
##'
##' @references For general information of the ISD see
##' \url{https://www.ncdc.noaa.gov/isd} and the map here
##' \url{https://gis.ncdc.noaa.gov/map/viewer/#app=cdo&cfg=cdo&theme=hourly&layers=1}.
##' \url{https://gis.ncdc.noaa.gov/maps/ncei}.
##' @keywords methods
##'
##' @name worldmet
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -5,7 +5,7 @@ worldmet - R package for accessing NOAA Integrated Surface Database (ISD) meteor

[![Travis-CI Build Status](https://travis-ci.org/davidcarslaw/worldmet.svg?branch=master)](https://travis-ci.org/davidcarslaw/worldmet)

`worldmet` provides an easy way to access data from the [NOAA Integrated Surface Database](https://www.ncdc.noaa.gov/isd) (ISD). The ISD contains detailed surface meteorological data from around the world for over 35,000 locations. See also the [map](https://gis.ncdc.noaa.gov/map/viewer/#app=cdo&cfg=cdo&theme=hourly&layers=1).
`worldmet` provides an easy way to access data from the [NOAA Integrated Surface Database](https://www.ncdc.noaa.gov/isd) (ISD). The ISD contains detailed surface meteorological data from around the world for over 35,000 locations. See also the [map](https://gis.ncdc.noaa.gov/maps/ncei).

The package outputs (typically hourly meteorological data) work very well with the [openair](https://github.com/davidcarslaw/openair) package.

Expand Down
2 changes: 1 addition & 1 deletion man/importNOAA.Rd

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

2 changes: 1 addition & 1 deletion man/worldmet.Rd

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

0 comments on commit 05dae45

Please sign in to comment.