From 8afe0e026bebbebfbd869c931605766ec2083c96 Mon Sep 17 00:00:00 2001 From: bczernecki Date: Wed, 28 Jul 2021 14:59:18 +0200 Subject: [PATCH 1/4] hydr_imgw documentation --- R/hydro_imgw.R | 2 +- man/hydro_imgw.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/hydro_imgw.R b/R/hydro_imgw.R index ccef235..2c4ea37 100644 --- a/R/hydro_imgw.R +++ b/R/hydro_imgw.R @@ -1,6 +1,6 @@ #' Hydrological data from IMGW #' -#' Downloading hourly, daily, and monthly hydrological data from the measurement stations available in the danepubliczne.imgw.pl collection +#' Downloading daily, and monthly hydrological data from the measurement stations available in the danepubliczne.imgw.pl collection #' #' @param interval temporal resolution of the data ("daily" , "monthly", or "semiannual_and_annual") #' @param year vector of years (e.g., 1966:2000) diff --git a/man/hydro_imgw.Rd b/man/hydro_imgw.Rd index 3318fd6..7ffc8d5 100644 --- a/man/hydro_imgw.Rd +++ b/man/hydro_imgw.Rd @@ -35,7 +35,7 @@ A data.frame with columns describing the hydrological parameters (e.g. flow, wat depending on the interval, at a given hour, month or year. If \code{coords = TRUE} additional two columns with geografic coordinates are added. } \description{ -Downloading hourly, daily, and monthly hydrological data from the measurement stations available in the danepubliczne.imgw.pl collection +Downloading daily, and monthly hydrological data from the measurement stations available in the danepubliczne.imgw.pl collection } \examples{ \donttest{ From 8c4a066f4b63f4aabab33abcb026e950ca7b7117 Mon Sep 17 00:00:00 2001 From: bczernecki Date: Fri, 17 Sep 2021 14:54:40 +0200 Subject: [PATCH 2/4] column name fixes --- R/ogimet_daily.R | 2 +- R/ogimet_hourly.R | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/R/ogimet_daily.R b/R/ogimet_daily.R index f1b3f97..2b9fd64 100644 --- a/R/ogimet_daily.R +++ b/R/ogimet_daily.R @@ -109,7 +109,7 @@ ogimet_daily = function(date = c(Sys.Date() - 30, Sys.Date()), coords = FALSE, s test = b[1:2, ] if (is.null(test) ) { - warning(paste0("Wrong station ID: ", station_nr, " You can check station ID at https://ogimet.com/display_stations.php?lang=en&tipo=AND&isyn=&oaci=&nombre=&estado=&Send=Send")) + warning(paste0("Wrong station ID: ", station_nr, " You can check available stations ID at https://ogimet.com/display_stations.php?lang=en&tipo=AND&isyn=&oaci=&nombre=&estado=&Send=Send")) return(data_station) } diff --git a/R/ogimet_hourly.R b/R/ogimet_hourly.R index 9d83b5d..4dc4164 100644 --- a/R/ogimet_hourly.R +++ b/R/ogimet_hourly.R @@ -144,10 +144,12 @@ ogimet_hourly = function(date = c("2019-06-01","2019-07-31"), coords = FALSE, st data_station$hour = NULL # other columns to numeric: - suppressWarnings(data_station[, c("TC", "TdC", "ffkmh", "Gustkmh", "P0hPa", "PseahPa", "PTnd", "Nt", "Nh", - "HKm", "InsoD1", "Viskm", "Snowcm","station_ID")] <- - as.data.frame(sapply(data_station[,c("TC", "TdC", "ffkmh", "Gustkmh", "P0hPa", "PseahPa", "PTnd", "Nt","Nh", - "HKm", "InsoD1", "Viskm", "Snowcm","station_ID")], as.numeric))) + columns = c("TC", "TdC", "ffkmh", "Gustkmh", "P0hPa", "PseahPa", "PTnd", "Nt", "Nh", + "HKm", "InsoD1", "Viskm", "Snowcm", "station_ID") + columns = colnames(data_station)[(colnames(data_station) %in% columns)] + + suppressWarnings(data_station[, columns] <- + as.data.frame(sapply(data_station[,columns], as.numeric))) # TODO: # changing order of columns and removing blank records: From f0281888683e44f71440d2bc63c4932c314ec31f Mon Sep 17 00:00:00 2001 From: Bartosz Czernecki Date: Fri, 17 Sep 2021 15:28:05 +0200 Subject: [PATCH 3/4] Update R-CMD-check.yaml --- .github/workflows/R-CMD-check.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 0fa3f56..d59d8cb 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -31,7 +31,6 @@ jobs: matrix: config: - {os: macOS-latest, r: 'release'} - - {os: windows-latest, r: 'release'} - {os: windows-latest, r: '3.6'} - {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} - {os: ubuntu-16.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} From bd8bc63d78e7f6fb9469059e7c64c154970fb441 Mon Sep 17 00:00:00 2001 From: bczernecki Date: Fri, 17 Sep 2021 15:32:21 +0200 Subject: [PATCH 4/4] update news.md --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 4491ebb..969b340 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ * Adding possibility to download BUFR vertical sounding dataset from `http://weather.uwyo.edu/upperair/sounding.html`; extra information with supporting example added to the `sounding_wyoming`'s documentation * `hydro_imgw` supports now exception for current year which has no flow data until it is verified by the IMGW-PIB +* `ogimet_daily` automatically detects column names to be used for extraction in final data.frame # climate 1.0.1