diff --git a/R/clean_metadata_hydro.R b/R/clean_metadata_hydro.R index 0879717..740d774 100644 --- a/R/clean_metadata_hydro.R +++ b/R/clean_metadata_hydro.R @@ -5,6 +5,7 @@ #' @param interval temporal interval #' @importFrom utils read.fwf #' @keywords internal + clean_metadata_hydro = function(address, interval) { temp = tempfile() diff --git a/R/get_coord_from_string.R b/R/get_coord_from_string.R index ae15d7b..67714e6 100644 --- a/R/get_coord_from_string.R +++ b/R/get_coord_from_string.R @@ -7,7 +7,8 @@ #' @format The returned object is the geographic coordinates using WGS84 (EPSG:4326) in decimal format. #' Negative values mean western or southern Hemisphere #' @keywords internal -#' +#' @noRd + get_coord_from_string = function(txt, pattern = "Longitude") { tt = gregexpr(pattern, txt) start = tt[[1]][1] + attributes(tt[[1]])$match.length + 1 diff --git a/R/hydro_imgw_daily.R b/R/hydro_imgw_daily.R index 2469576..4c057cc 100644 --- a/R/hydro_imgw_daily.R +++ b/R/hydro_imgw_daily.R @@ -96,17 +96,9 @@ hydro_imgw_daily_bp = function(year, } # extra exception for a current year according to information provided by IMGW-PIB: # i.e.: - # "Do czasu zakończenia kontroli przepływów z roku hydrologicznego 2020 (do około poczatku sierpnia 2021), - # rekordy z danymi z roku 2020 mają format: - #Kod stacji - #Nazwa stacji - #Nazwa rzeki/jeziora - #Rok hydrologiczny - #Wskaźnik miesiąca w roku hydrologicznym - #Dzień - #Stan wody [cm] - #Temperatura wody [st. C] - #Miesiąc kalendarzowy + # "Do czasu zakonczenia kontroli przeplywow rekordy z danymi z roku 2020 maja format: + #Kod stacji #Nazwa stacji #Nazwa rzeki/jeziora #Rok hydrologiczny #Wskaznik miesiaca w roku hydrologicznym + #Dzien #Stan wody [cm] #Temperatura wody [st. C] #Miesiac kalendarzowy if (ncol(data1) == 9) { data1$flow = NA data1 = data1[, c(1:7, 10, 8:9)] @@ -131,9 +123,7 @@ hydro_imgw_daily_bp = function(year, colnames(data2) = meta[[2]][, 1] all_data[[i]] = merge(data, data2, - by = c("Kod stacji", "Nazwa stacji", - "Rok hydrologiczny", "Nazwa rzeki/jeziora", - "Wskaźnik miesiąca w roku hydrologicznym", "Dzień"), + by = intersect(colnames(data), colnames(data2)), all.x = TRUE) } @@ -166,11 +156,7 @@ hydro_imgw_daily_bp = function(year, } } - all_data = all_data[order(all_data$`Nazwa stacji`, - all_data$`Rok hydrologiczny`, - all_data$`Wskaźnik miesiąca w roku hydrologicznym`, - all_data$`Dzień`), ] - # dodanie opcji dla skracania kolumn i usuwania duplikatow: + all_data = all_data[do.call(order, all_data[grep(x = colnames(all_data), "Nazwa stacji|Rok hydro|w roku hydro|Dzie")]), ] all_data = hydro_shortening_imgw(all_data, col_names = col_names, ...) return(all_data) diff --git a/R/hydro_imgw_monthly.R b/R/hydro_imgw_monthly.R index 9b58d11..897f2df 100644 --- a/R/hydro_imgw_monthly.R +++ b/R/hydro_imgw_monthly.R @@ -120,10 +120,7 @@ hydro_imgw_monthly_bp = function(year, stop("Selected station(s) are not in the proper format.", call. = FALSE) } } - - all_data = all_data[order(all_data$`Nazwa stacji`, - all_data$`Rok hydrologiczny`, - all_data$`Wskaźnik miesiąca w roku hydrologicznym`), ] + all_data = all_data[do.call(order, all_data[grep(x = colnames(all_data), "Nazwa stacji|Rok hydrologiczny|w roku hydro")]), ] all_data = hydro_shortening_imgw(all_data, col_names = col_names, ...) return(all_data) diff --git a/R/hydro_metadata_imgw.R b/R/hydro_metadata_imgw.R index e9a39a4..2002819 100644 --- a/R/hydro_metadata_imgw.R +++ b/R/hydro_metadata_imgw.R @@ -6,6 +6,7 @@ #' @param interval temporal resolution of the data ("daily" , "monthly", or "semiannual_and_annual") #' @param allow_failure logical - whether to proceed or stop on failure. By default set to TRUE (i.e. don't stop on error). For debugging purposes change to FALSE #' @keywords internal +#' @noRd hydro_metadata_imgw = function(interval, allow_failure = TRUE) { diff --git a/R/meteo_imgw.R b/R/meteo_imgw.R index ace785f..4e66261 100644 --- a/R/meteo_imgw.R +++ b/R/meteo_imgw.R @@ -1,7 +1,7 @@ -#' Meteorological data from IMGW +#' Meteorological data from the IMGW-PIB official repository #' #' Downloading hourly, daily, and monthly meteorological data from the -#' SYNOP / CLIMATE / PRECIP stations available in the danepubliczne.imgw.pl collection +#' SYNOP / CLIMATE / PRECIP stations available in the danepubliczne.imgw.pl collection. #' #' @param interval temporal resolution of the data ("hourly", "daily", "monthly") #' @param rank rank of the stations: "synop" (default), "climate" or "precip" diff --git a/R/meteo_imgw_daily.R b/R/meteo_imgw_daily.R index 1060dac..36461d3 100644 --- a/R/meteo_imgw_daily.R +++ b/R/meteo_imgw_daily.R @@ -88,7 +88,7 @@ meteo_imgw_daily_bp = function(rank, split = "_") years_in_catalogs = lapply(years_in_catalogs, function(x) x[1]:x[length(x)]) ind = lapply(years_in_catalogs, function(x) sum(x %in% year) > 0) - catalogs = catalogs[unlist(ind)] # to sa nasze prawdziwe catalogs do przemielenia + catalogs = catalogs[unlist(ind)] all_data = NULL @@ -163,9 +163,6 @@ meteo_imgw_daily_bp = function(rank, ind = grep(readHTMLTable(folder_contents)[[1]]$Name, pattern = "zip") files = as.character(readHTMLTable(folder_contents)[[1]]$Name[ind]) addresses_to_download = paste0(address, files) - # w tym miejscu trzeba przemyslec fragment kodu - # do dodania dla pojedynczej stacji jesli tak sobie zazyczy uzytkownik: - # na podstawie zawartosci obiektu files for (j in seq_along(addresses_to_download)) { temp = tempfile() @@ -199,11 +196,11 @@ meteo_imgw_daily_bp = function(rank, data2, by = c("Kod stacji", "Rok", "Miesiac", "Dzien"), all.x = TRUE) - } # koniec petli po zipach do pobrania - } # koniec if'a dla klimatu + } # end of looping for zip files + } # end of if statement for climate stations - ###################### - ######## OPAD: ####### + ######################## + ######## PRECIP: ####### if (rank == "precip") { address = paste0(base_url, "dane_meteorologiczne/dobowe/opad", "/", catalog, "/") @@ -236,10 +233,9 @@ meteo_imgw_daily_bp = function(rank, unlink(c(temp, temp2)) all_data[[length(all_data) + 1]] = data1 - } # koniec petli po zipach do pobrania - } # koniec if'a dla klimatu - - } # koniec petli po glownych catalogach danych dobowych + } # end of loop for zip files + } # end of if statement for climate stations + } # end of looping over catalogs all_data = do.call(rbind, all_data) @@ -251,11 +247,11 @@ meteo_imgw_daily_bp = function(rank, all.y = TRUE) } - # dodaje rank + # add station rank: rank_code = switch(rank, synop = "SYNOPTYCZNA", climate = "KLIMATYCZNA", precip = "OPADOWA") all_data = cbind(data.frame(rank_code = rank_code), all_data) - all_data = all_data[all_data$Rok %in% year, ] # przyciecie tylko do wybranych lat gdyby sie pobralo za duzo + all_data = all_data[all_data$Rok %in% year, ] # clip only to selected years #station selection if (!is.null(station)) { diff --git a/R/meteo_imgw_datastore.R b/R/meteo_imgw_datastore.R index fbf357d..649429b 100644 --- a/R/meteo_imgw_datastore.R +++ b/R/meteo_imgw_datastore.R @@ -30,8 +30,8 @@ #' @import data.table #' @export #' -#' @examples \donttest{ -#' # download only air temperature for selected 2 stations in 2022-2023: +#' @examples +#' \donttest{ #' imgw_telemetry = meteo_imgw_datastore(year = 2022:2023, #' parameters = "t2m", #' stations = c("HALA GĄSIENICOWA", diff --git a/R/meteo_imgw_monthly.R b/R/meteo_imgw_monthly.R index 4b37858..a792a0d 100644 --- a/R/meteo_imgw_monthly.R +++ b/R/meteo_imgw_monthly.R @@ -9,11 +9,14 @@ #' (default status = FALSE - i.e. the status columns are deleted) #' @param coords add coordinates of the station (logical value TRUE or FALSE) #' @param station name or ID of meteorological station(s). -#' It accepts names (characters in CAPITAL LETTERS) or stations' IDs (numeric) +#' It accepts names (characters in CAPITAL LETTERS) or stations' IDs (numeric). +#' Please note that station names may change over time and thus sometimes 2 names +#' are required in some cases, e.g. `c("POZNAŃ", "POZNAŃ-ŁAWICA")`. #' @param col_names three types of column names possible: "short" - default, #' values with shorten names, "full" - full English description, #' "polish" - original names in the dataset -#' @param allow_failure logical - whether to proceed or stop on failure. By default set to TRUE (i.e. don't stop on error). For debugging purposes change to FALSE +#' @param allow_failure logical - whether to proceed or stop on failure. +#' By default set to TRUE (i.e. don't stop on error). For debugging purposes change to FALSE #' @param ... other parameters that may be passed to the #' 'shortening' function that shortens column names #' @importFrom XML readHTMLTable @@ -21,7 +24,8 @@ #' @importFrom data.table fread #' @export #' -#' @examples \donttest{ +#' @examples +#' \donttest{ #' monthly = meteo_imgw_monthly(rank = "climate", year = 1969) #' head(monthly) #' @@ -29,11 +33,6 @@ #' monthly2 = meteo_imgw_monthly(rank = "synop", year = 2018, #' col_names = "full") #' head(monthly2) -#' -#' # please note that station names may change over time -#' # and thus 2 names are required in some cases: -#' # df = meteo_imgw_monthly(rank = 'synop', year = 1991:2000, -#' # coords = TRUE, station = c("POZNAŃ","POZNAŃ-ŁAWICA")) #' } #' meteo_imgw_monthly = function(rank = "synop", diff --git a/R/meteo_metadata_imgw.R b/R/meteo_metadata_imgw.R index ad9c6d3..95e0291 100644 --- a/R/meteo_metadata_imgw.R +++ b/R/meteo_metadata_imgw.R @@ -1,18 +1,13 @@ #' Meteorological metadata #' -#' Downloading the description (metadata) to the meteorological data available in the dane.imgw repository.imgw.pl. +#' Downloading the description (metadata) to the meteorological data available in the +#' danepubliczne.imgw.pl collection. #' By default, the function returns a list or data frame for a selected subset #' #' @param interval temporal resolution of the data ("hourly", "daily", "monthly") #' @param rank rank of station ("synop", "climate", "precip") #' @keywords internal -#' -#' @examples -#' \donttest{ -#' #meta = climate:::meteo_metadata_imgw(interval = "hourly", rank = "synop") -#' #meta = climate:::meteo_metadata_imgw(interval = "daily", rank = "synop") -#' #meta = climate:::meteo_metadata_imgw(interval = "monthly", rank = "precip") -#' } +#' @noRd meteo_metadata_imgw = function(interval, rank) { # interval can be: monthly, hourly, hourly @@ -64,7 +59,7 @@ meteo_metadata_imgw = function(interval, rank) { # interval can be: monthly, hou rank = "precip", interval = "monthly") } - } # koniec MIESIECZNYCH + } # end of monthly interval ## hourly data section: if (interval == "hourly") { diff --git a/R/meteo_noaa_co2.R b/R/meteo_noaa_co2.R index 33f9ed9..64dba4d 100644 --- a/R/meteo_noaa_co2.R +++ b/R/meteo_noaa_co2.R @@ -35,10 +35,15 @@ #' @importFrom utils data #' @export #' -#' @examples \donttest{ -#' #co2 = meteo_noaa_co2() -#' #head(co2) -#' #plot(co2$yy_d, co2$co2_avg, type='l') +#' @examples +#' \donttest{ +#' co2 = meteo_noaa_co2() +#' head(co2) +#' plot(x = co2$yy_d, y = co2$co2_avg, +#' type='l', +#' main = "CO2 concentration at Mauna Loa Observatory", +#' xlab = "years", +#' ylab = "CO2 (ppm)") #' } #' diff --git a/R/meteo_noaa_hourly.R b/R/meteo_noaa_hourly.R index a550fd5..7279c1e 100644 --- a/R/meteo_noaa_hourly.R +++ b/R/meteo_noaa_hourly.R @@ -17,8 +17,6 @@ #' # London-Heathrow, United Kingdom #' noaa = meteo_noaa_hourly(station = "037720-99999", year = 1949) #' } -#' - meteo_noaa_hourly = function(station = NULL, year = 2019, diff --git a/R/meteo_shortening_imgw.R b/R/meteo_shortening_imgw.R index 41a6012..9d41c68 100644 --- a/R/meteo_shortening_imgw.R +++ b/R/meteo_shortening_imgw.R @@ -10,7 +10,7 @@ #' @examples #' \donttest{ #' monthly = meteo_imgw("monthly", rank = "climate", year = 1969) -#' # colnames(monthly) +#' #' abbr = meteo_shortening_imgw(data = monthly, #' col_names = "full", #' remove_duplicates = TRUE) diff --git a/R/nearest_stations_ogimet.R b/R/nearest_stations_ogimet.R index 0b0b63f..8590f9f 100644 --- a/R/nearest_stations_ogimet.R +++ b/R/nearest_stations_ogimet.R @@ -19,10 +19,10 @@ #' #' @examples #' \donttest{ -#' nearest_stations_ogimet(country = "Uniced Kingdom", +#' nearest_stations_ogimet(country = "United Kingdom", #' point = c(-2, 50), #' add_map = TRUE, -#' no_of_stations = 0, +#' no_of_stations = 50, #' allow_failure = TRUE, #' main = "Meteo stations in UK") #' } diff --git a/R/ogimet_daily.R b/R/ogimet_daily.R index 063b921..b72d641 100644 --- a/R/ogimet_daily.R +++ b/R/ogimet_daily.R @@ -12,10 +12,9 @@ #' @importFrom utils setTxtProgressBar txtProgressBar #' #' @export -#' -#' @keywords internal #' -#' @examples \donttest{ +#' @examples +#' \donttest{ #' # downloading daily summaries for last 30 days. station: New York - La Guardia #' new_york = ogimet_daily(station = 72503, coords = TRUE) #' } diff --git a/R/ogimet_hourly.R b/R/ogimet_hourly.R index 6b7ba19..f421d87 100644 --- a/R/ogimet_hourly.R +++ b/R/ogimet_hourly.R @@ -183,7 +183,6 @@ ogimet_hourly_bp = function(date = date, suppressWarnings(data_station[, columns] <- as.data.frame(sapply(data_station[,columns], as.numeric))) - # TODO: # changing order of columns and removing blank records: if (coords) { ord1 = c("station_ID", "Lon", "Lat", "Date", "TC") diff --git a/R/onAttach.R b/R/onAttach.R index b4a2271..dd2d034 100644 --- a/R/onAttach.R +++ b/R/onAttach.R @@ -4,7 +4,7 @@ #' @export .onAttach = function(libname, pkgname) { - if ((runif (1) < 0.25) & interactive()) { # activate occasionally and only if not run as Rscript + if ((runif(1) < 0.25) & interactive()) { # activate occasionally and only if not run as Rscript ver = as.character(packageVersion("climate")) packageStartupMessage(paste0(c("\n____________________________________________________________________\n", " Welcome to climate ", ver, "!", diff --git a/R/precip_split.R b/R/precip_split.R index 023c2ca..e133317 100644 --- a/R/precip_split.R +++ b/R/precip_split.R @@ -5,8 +5,8 @@ #' @param pattern 6h-12h-24h precipitation pattern to obtain written as: "/6h", "/12h" , "/24h" (see examples) #' #' @keywords internal -#' -#' +#' @noRd + precip_split = function(precip, pattern = "/12") { b = strsplit(precip, "h", fixed = TRUE) b = lapply(b, function(x) x[grepl(x, pattern = pattern, fixed = TRUE)]) diff --git a/R/profile_demo.R b/R/profile_demo.R index 0d957ce..df0641b 100644 --- a/R/profile_demo.R +++ b/R/profile_demo.R @@ -1,7 +1,7 @@ #' @name profile_demo #' @title Exemplary sounding profile from University of Wyoming dataset #' -#' @description The object contains pre-downloaded atmospheric (sounding) profile for Łeba, PL rawinsonde station. +#' @description The object contains pre-downloaded atmospheric (sounding) profile for Leba, PL rawinsonde station. #' The measurement was taken 2000/03/23 at 00 UTC. #' #' @importFrom utils data diff --git a/R/sounding_wyoming.R b/R/sounding_wyoming.R index 03eb18d..2f7cc8b 100644 --- a/R/sounding_wyoming.R +++ b/R/sounding_wyoming.R @@ -2,7 +2,7 @@ #' #' Downloading the measurements of the vertical profile of atmosphere (also known as sounding data). Data can be retrieved using TEMP and BUFR sounding formatting. #' -#' @param wmo_id international WMO station code (World Meteorological Organization ID); For Polish stations: Łeba - 12120, Legionowo - 12374, Wrocław- 12425 +#' @param wmo_id international WMO station code (World Meteorological Organization ID); For Polish stations: Leba - 12120, Legionowo - 12374, Wrocław- 12425 #' @param yy year - single number #' @param mm month - single number denoting month #' @param dd day - single number denoting day @@ -41,11 +41,11 @@ #' ############################################################################## #' TEMP = sounding_wyoming(wmo_id = 45004, yy = 2021, mm = 07, dd = 17, #' hh = 12, min = 00) -#' #head(TEMP[[1]]) +#' head(TEMP[[1]]) #' #' BUFR = sounding_wyoming(wmo_id = 45004, yy = 2021, mm = 07, dd = 17, #' hh = 12, min = 00, bufr = TRUE) -#' #head(BUFR[[1]]) +#' head(BUFR[[1]]) #' #' #' ############################################################################## @@ -57,8 +57,7 @@ #' mm = sample(1:12,1), #' dd = sample(1:20,1), #' hh = 0) -#' # head(profile) -#' # plot(profile[[1]]$HGHT, profile[[1]]$PRES, type = 'l') +#' plot(profile[[1]]$HGHT, profile[[1]]$PRES, type = 'l') #' } #' diff --git a/R/spheroid_dist.R b/R/spheroid_dist.R index 4adf33c..3696f68 100644 --- a/R/spheroid_dist.R +++ b/R/spheroid_dist.R @@ -7,7 +7,7 @@ #' @param p1 coordinates of the first point in decimal degrees (LON, LAT) #' @param p2 coordinates of the second point in decimal degrees (LON, LAT) #' -#' @return distance between two locations in kilometers +#' @return distance between two locations (in kilometers) #' @export #' @examples diff --git a/R/stations_meteo_imgw_telemetry.R b/R/stations_meteo_imgw_telemetry.R index 550fcb4..e2660bf 100644 --- a/R/stations_meteo_imgw_telemetry.R +++ b/R/stations_meteo_imgw_telemetry.R @@ -2,11 +2,13 @@ #' #' Retrieving current metadata for stations used in the telemetric systems of the IMGW-PIB datastore (danepubliczne.imgw.pl/datastore) #' -#' @return data table with metadata for over 500 stations. Metadata contains: station ID, station name, river, latitude, longitude, altitude +#' @return data table with metadata for over 500 stations. +#' Metadata contains: station ID, station name, river, latitude, longitude, altitude #' @importFrom data.table as.data.table #' @export #' -#' @examples \donttest{ +#' @examples +#' \donttest{ #' telemetry_stations = stations_meteo_imgw_telemetry() #' } #' diff --git a/R/stations_ogimet.R b/R/stations_ogimet.R index bf617ec..c341c87 100644 --- a/R/stations_ogimet.R +++ b/R/stations_ogimet.R @@ -2,9 +2,9 @@ #' #' Returns a list of meteorological stations with their coordinates from the Ogimet webpage. The returned list is valid only for a given day #' -#' @param country country name; for more than two words they need to be separated with a plus character (e.g. "United+Kingdom") +#' @param country country name; Every word must be written with capital letters (e.g. "United Kingdom") #' @param date a day when measurements were done in all available locations -#' @param add_map logical - whether to draw a map with downloaded metadata (requires maps/mapdata packages) +#' @param add_map logical - whether to draw a map based on downloaded dataset (requires `maps` package) #' @param allow_failure logical - whether to proceed or stop on failure. By default set to TRUE (i.e. don't stop on error). For debugging purposes change to FALSE #' @importFrom XML readHTMLTable #' @export @@ -18,7 +18,7 @@ #' #' -stations_ogimet = function(country = "United+Kingdom", +stations_ogimet = function(country = "United Kingdom", date = Sys.Date(), add_map = FALSE, allow_failure = TRUE) { @@ -41,6 +41,8 @@ stations_ogimet_bp = function(country = country, date = date, add_map = add_map) stop("Too many countries selected. Please choose only one country") } + country = gsub(x = country, pattern = " ", replacement = "+") + if (length(date) != 1) { stop("You can check available nearest stations for one day. Please chenge selection") diff --git a/R/test_url.R b/R/test_url.R index 06169b3..287f8fa 100644 --- a/R/test_url.R +++ b/R/test_url.R @@ -54,17 +54,4 @@ test_url = function(link, output, quiet = FALSE) { message(paste0("\nCheck: ", link, " in your browser!\n")) return(invisible(NULL)) } - } - -# b = gracefully_fail("http://httpbin.org/status/404") # http >400 -# #> Not Found (HTTP 404). -# gracefully_fail("http://httpbin.org/delay/11") # Timeout -# #> Timeout was reached: [httpbin.org] Operation timed out after 1000 milliseconds with 0 bytes received -# a = gracefully_fail("http://httpbin.org") #OK -# -# b = curl_download(url = "http://httpbin.org", destfile = tempfile()) -# b = curl_download(url = "http://httpbin.org/status/404", destfile = tempfile()) -# -# url = "http://www2.census.gov/acs2011_5yr/pums/csv_pus.zip" -# test_url(link = url, output = tempfile()) diff --git a/man/get_coord_from_string.Rd b/man/get_coord_from_string.Rd deleted file mode 100644 index 46e4cb4..0000000 --- a/man/get_coord_from_string.Rd +++ /dev/null @@ -1,21 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/get_coord_from_string.R -\name{get_coord_from_string} -\alias{get_coord_from_string} -\title{Getting coordinates from a string provided by the Ogimet web portal} -\format{ -The returned object is the geographic coordinates using WGS84 (EPSG:4326) in decimal format. -Negative values mean western or southern Hemisphere -} -\usage{ -get_coord_from_string(txt, pattern = "Longitude") -} -\arguments{ -\item{txt}{string with coordinates from Ogimet} - -\item{pattern}{which element (Longitude or Latitude) to extract} -} -\description{ -Internal function for cleaning coordinates' metadata provided by Ogimet -} -\keyword{internal} diff --git a/man/hydro_metadata_imgw.Rd b/man/hydro_metadata_imgw.Rd deleted file mode 100644 index d152180..0000000 --- a/man/hydro_metadata_imgw.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/hydro_metadata_imgw.R -\name{hydro_metadata_imgw} -\alias{hydro_metadata_imgw} -\title{Hydrological metadata} -\usage{ -hydro_metadata_imgw(interval, allow_failure = TRUE) -} -\arguments{ -\item{interval}{temporal resolution of the data ("daily" , "monthly", or "semiannual_and_annual")} - -\item{allow_failure}{logical - whether to proceed or stop on failure. By default set to TRUE (i.e. don't stop on error). For debugging purposes change to FALSE} -} -\description{ -Downloading the description (metadata) to hydrological data available in the danepubliczne.imgw.pl repository. -By default, the function returns a list or data frame for a selected subset -} -\keyword{internal} diff --git a/man/meteo_imgw.Rd b/man/meteo_imgw.Rd index fc4a69d..4ed5913 100644 --- a/man/meteo_imgw.Rd +++ b/man/meteo_imgw.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/meteo_imgw.R \name{meteo_imgw} \alias{meteo_imgw} -\title{Meteorological data from IMGW} +\title{Meteorological data from the IMGW-PIB official repository} \usage{ meteo_imgw( interval, @@ -45,7 +45,7 @@ columns with geographic coordinates are added. } \description{ Downloading hourly, daily, and monthly meteorological data from the -SYNOP / CLIMATE / PRECIP stations available in the danepubliczne.imgw.pl collection +SYNOP / CLIMATE / PRECIP stations available in the danepubliczne.imgw.pl collection. } \examples{ \donttest{ diff --git a/man/meteo_imgw_datastore.Rd b/man/meteo_imgw_datastore.Rd index c010be3..b22431a 100644 --- a/man/meteo_imgw_datastore.Rd +++ b/man/meteo_imgw_datastore.Rd @@ -54,7 +54,6 @@ Data from the IMGW automated (telemetry) systems are non validated by experts an } \examples{ \donttest{ -# download only air temperature for selected 2 stations in 2022-2023: imgw_telemetry = meteo_imgw_datastore(year = 2022:2023, parameters = "t2m", stations = c("HALA GĄSIENICOWA", diff --git a/man/meteo_imgw_monthly.Rd b/man/meteo_imgw_monthly.Rd index 6e3fa20..f88d58e 100644 --- a/man/meteo_imgw_monthly.Rd +++ b/man/meteo_imgw_monthly.Rd @@ -26,13 +26,16 @@ meteo_imgw_monthly( \item{coords}{add coordinates of the station (logical value TRUE or FALSE)} \item{station}{name or ID of meteorological station(s). -It accepts names (characters in CAPITAL LETTERS) or stations' IDs (numeric)} +It accepts names (characters in CAPITAL LETTERS) or stations' IDs (numeric). +Please note that station names may change over time and thus sometimes 2 names +are required in some cases, e.g. \code{c("POZNAŃ", "POZNAŃ-ŁAWICA")}.} \item{col_names}{three types of column names possible: "short" - default, values with shorten names, "full" - full English description, "polish" - original names in the dataset} -\item{allow_failure}{logical - whether to proceed or stop on failure. By default set to TRUE (i.e. don't stop on error). For debugging purposes change to FALSE} +\item{allow_failure}{logical - whether to proceed or stop on failure. +By default set to TRUE (i.e. don't stop on error). For debugging purposes change to FALSE} \item{...}{other parameters that may be passed to the 'shortening' function that shortens column names} @@ -50,11 +53,6 @@ SYNOP / CLIMATE / PRECIP stations available in the danepubliczne.imgw.pl collect monthly2 = meteo_imgw_monthly(rank = "synop", year = 2018, col_names = "full") head(monthly2) - - # please note that station names may change over time - # and thus 2 names are required in some cases: - # df = meteo_imgw_monthly(rank = 'synop', year = 1991:2000, - # coords = TRUE, station = c("POZNAŃ","POZNAŃ-ŁAWICA")) } } diff --git a/man/meteo_metadata_imgw.Rd b/man/meteo_metadata_imgw.Rd deleted file mode 100644 index 6fc0de9..0000000 --- a/man/meteo_metadata_imgw.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/meteo_metadata_imgw.R -\name{meteo_metadata_imgw} -\alias{meteo_metadata_imgw} -\title{Meteorological metadata} -\usage{ -meteo_metadata_imgw(interval, rank) -} -\arguments{ -\item{interval}{temporal resolution of the data ("hourly", "daily", "monthly")} - -\item{rank}{rank of station ("synop", "climate", "precip")} -} -\description{ -Downloading the description (metadata) to the meteorological data available in the dane.imgw repository.imgw.pl. -By default, the function returns a list or data frame for a selected subset -} -\examples{ -\donttest{ - #meta = climate:::meteo_metadata_imgw(interval = "hourly", rank = "synop") - #meta = climate:::meteo_metadata_imgw(interval = "daily", rank = "synop") - #meta = climate:::meteo_metadata_imgw(interval = "monthly", rank = "precip") -} -} -\keyword{internal} diff --git a/man/meteo_noaa_co2.Rd b/man/meteo_noaa_co2.Rd index 5f21101..4b731ed 100644 --- a/man/meteo_noaa_co2.Rd +++ b/man/meteo_noaa_co2.Rd @@ -38,9 +38,13 @@ CO2 expressed as a mole fraction in dry air, micromol/mol, abbreviated as ppm } \examples{ \donttest{ - #co2 = meteo_noaa_co2() - #head(co2) - #plot(co2$yy_d, co2$co2_avg, type='l') + co2 = meteo_noaa_co2() + head(co2) + plot(x = co2$yy_d, y = co2$co2_avg, + type='l', + main = "CO2 concentration at Mauna Loa Observatory", + xlab = "years", + ylab = "CO2 (ppm)") } } diff --git a/man/meteo_noaa_hourly.Rd b/man/meteo_noaa_hourly.Rd index a77a2e5..d6cce81 100644 --- a/man/meteo_noaa_hourly.Rd +++ b/man/meteo_noaa_hourly.Rd @@ -31,5 +31,4 @@ Further details available at: https://www1.ncdc.noaa.gov/pub/data/noaa/readme.tx # London-Heathrow, United Kingdom noaa = meteo_noaa_hourly(station = "037720-99999", year = 1949) } - } diff --git a/man/meteo_shortening_imgw.Rd b/man/meteo_shortening_imgw.Rd index f7b6592..3e4436a 100644 --- a/man/meteo_shortening_imgw.Rd +++ b/man/meteo_shortening_imgw.Rd @@ -19,7 +19,7 @@ Shortening column names of meteorological parameters to improve the readability \examples{ \donttest{ monthly = meteo_imgw("monthly", rank = "climate", year = 1969) - # colnames(monthly) + abbr = meteo_shortening_imgw(data = monthly, col_names = "full", remove_duplicates = TRUE) diff --git a/man/nearest_stations_ogimet.Rd b/man/nearest_stations_ogimet.Rd index 6431d4b..5694575 100644 --- a/man/nearest_stations_ogimet.Rd +++ b/man/nearest_stations_ogimet.Rd @@ -41,10 +41,10 @@ The returned list is valid only for a given day. } \examples{ \donttest{ - nearest_stations_ogimet(country = "Uniced Kingdom", + nearest_stations_ogimet(country = "United Kingdom", point = c(-2, 50), add_map = TRUE, - no_of_stations = 0, + no_of_stations = 50, allow_failure = TRUE, main = "Meteo stations in UK") } diff --git a/man/ogimet_daily.Rd b/man/ogimet_daily.Rd index e2823a3..7e2d50a 100644 --- a/man/ogimet_daily.Rd +++ b/man/ogimet_daily.Rd @@ -34,4 +34,3 @@ The data are processed only if temperature or precipitation fields are present. } } -\keyword{internal} diff --git a/man/precip_split.Rd b/man/precip_split.Rd deleted file mode 100644 index e831a7e..0000000 --- a/man/precip_split.Rd +++ /dev/null @@ -1,17 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/precip_split.R -\name{precip_split} -\alias{precip_split} -\title{Splitting precipitation values to 6/12/24 hour periods and converting to numeric} -\usage{ -precip_split(precip, pattern = "/12") -} -\arguments{ -\item{precip}{vector of characters with precipitation field from Ogimet} - -\item{pattern}{6h-12h-24h precipitation pattern to obtain written as: "/6h", "/12h" , "/24h" (see examples)} -} -\description{ -Internal function for splitting precipitation field provided by Ogimet and converting string to numerical value -} -\keyword{internal} diff --git a/man/profile_demo.Rd b/man/profile_demo.Rd index f0ce083..76cab8c 100644 --- a/man/profile_demo.Rd +++ b/man/profile_demo.Rd @@ -11,7 +11,7 @@ The data contains list of two data.frames as derived using sounding_wyoming() fu profile_demo } \description{ -The object contains pre-downloaded atmospheric (sounding) profile for Łeba, PL rawinsonde station. +The object contains pre-downloaded atmospheric (sounding) profile for Leba, PL rawinsonde station. The measurement was taken 2000/03/23 at 00 UTC. } \examples{ diff --git a/man/sounding_wyoming.Rd b/man/sounding_wyoming.Rd index 367af8c..8660bb3 100644 --- a/man/sounding_wyoming.Rd +++ b/man/sounding_wyoming.Rd @@ -19,7 +19,7 @@ sounding_wyoming( ) } \arguments{ -\item{wmo_id}{international WMO station code (World Meteorological Organization ID); For Polish stations: Łeba - 12120, Legionowo - 12374, Wrocław- 12425} +\item{wmo_id}{international WMO station code (World Meteorological Organization ID); For Polish stations: Leba - 12120, Legionowo - 12374, Wrocław- 12425} \item{yy}{year - single number} @@ -68,11 +68,11 @@ Downloading the measurements of the vertical profile of atmosphere (also known a ############################################################################## TEMP = sounding_wyoming(wmo_id = 45004, yy = 2021, mm = 07, dd = 17, hh = 12, min = 00) - #head(TEMP[[1]]) + head(TEMP[[1]]) BUFR = sounding_wyoming(wmo_id = 45004, yy = 2021, mm = 07, dd = 17, hh = 12, min = 00, bufr = TRUE) - #head(BUFR[[1]]) + head(BUFR[[1]]) ############################################################################## @@ -84,8 +84,7 @@ Downloading the measurements of the vertical profile of atmosphere (also known a mm = sample(1:12,1), dd = sample(1:20,1), hh = 0) - # head(profile) - # plot(profile[[1]]$HGHT, profile[[1]]$PRES, type = 'l') + plot(profile[[1]]$HGHT, profile[[1]]$PRES, type = 'l') } } diff --git a/man/spheroid_dist.Rd b/man/spheroid_dist.Rd index 5628e2f..5ad75e1 100644 --- a/man/spheroid_dist.Rd +++ b/man/spheroid_dist.Rd @@ -12,7 +12,7 @@ spheroid_dist(p1, p2) \item{p2}{coordinates of the second point in decimal degrees (LON, LAT)} } \value{ -distance between two locations in kilometers +distance between two locations (in kilometers) } \description{ Calculate the distance between two points on the surface of a spheroid diff --git a/man/stations_meteo_imgw_telemetry.Rd b/man/stations_meteo_imgw_telemetry.Rd index 17ca8b8..8cea35d 100644 --- a/man/stations_meteo_imgw_telemetry.Rd +++ b/man/stations_meteo_imgw_telemetry.Rd @@ -7,7 +7,8 @@ stations_meteo_imgw_telemetry() } \value{ -data table with metadata for over 500 stations. Metadata contains: station ID, station name, river, latitude, longitude, altitude +data table with metadata for over 500 stations. +Metadata contains: station ID, station name, river, latitude, longitude, altitude } \description{ Retrieving current metadata for stations used in the telemetric systems of the IMGW-PIB datastore (danepubliczne.imgw.pl/datastore) diff --git a/man/stations_ogimet.Rd b/man/stations_ogimet.Rd index afb3761..ffc0796 100644 --- a/man/stations_ogimet.Rd +++ b/man/stations_ogimet.Rd @@ -5,18 +5,18 @@ \title{Scrapping a list of meteorological (Synop) stations for a defined country from the Ogimet webpage} \usage{ stations_ogimet( - country = "United+Kingdom", + country = "United Kingdom", date = Sys.Date(), add_map = FALSE, allow_failure = TRUE ) } \arguments{ -\item{country}{country name; for more than two words they need to be separated with a plus character (e.g. "United+Kingdom")} +\item{country}{country name; Every word must be written with capital letters (e.g. "United Kingdom")} \item{date}{a day when measurements were done in all available locations} -\item{add_map}{logical - whether to draw a map with downloaded metadata (requires maps/mapdata packages)} +\item{add_map}{logical - whether to draw a map based on downloaded dataset (requires \code{maps} package)} \item{allow_failure}{logical - whether to proceed or stop on failure. By default set to TRUE (i.e. don't stop on error). For debugging purposes change to FALSE} }