From 7f05f4fefd04ba41864e33078d9e7f1fd47fba86 Mon Sep 17 00:00:00 2001 From: bczernecki Date: Fri, 18 Oct 2024 16:39:55 +0200 Subject: [PATCH] adding returns statement to .Rd files --- R/check_locale.R | 2 ++ R/clean_metadata_hydro.R | 1 + R/clean_metadata_meteo.R | 9 +-------- R/co2_demo.R | 1 + R/hydro_imgw.R | 2 +- R/hydro_imgw_annual.R | 1 + R/hydro_imgw_daily.R | 2 +- R/hydro_imgw_monthly.R | 1 + R/hydro_shortening_imgw.R | 1 + R/meteo_imgw_daily.R | 1 + R/meteo_imgw_datastore.R | 2 +- R/meteo_imgw_hourly.R | 1 + R/meteo_imgw_monthly.R | 1 + R/meteo_noaa_co2.R | 1 + R/meteo_noaa_hourly.R | 1 + R/meteo_shortening_imgw.R | 1 + R/ogimet_daily.R | 1 + R/ogimet_hourly.R | 1 + R/spheroid_dist.R | 7 +++---- R/test_url.R | 10 ++++++---- man/clean_metadata_hydro.Rd | 17 ----------------- man/clean_metadata_meteo.Rd | 19 ------------------- man/co2_demo.Rd | 9 +++++---- man/hydro_imgw.Rd | 2 +- man/hydro_imgw_annual.Rd | 3 +++ man/hydro_imgw_daily.Rd | 3 +++ man/hydro_imgw_monthly.Rd | 3 +++ man/hydro_shortening_imgw.Rd | 3 +++ man/meteo_imgw_daily.Rd | 3 +++ man/meteo_imgw_datastore.Rd | 3 +++ man/meteo_imgw_hourly.Rd | 3 +++ man/meteo_imgw_monthly.Rd | 3 +++ man/meteo_noaa_co2.Rd | 3 +++ man/meteo_noaa_hourly.Rd | 3 +++ man/meteo_shortening_imgw.Rd | 3 +++ man/ogimet_daily.Rd | 3 +++ man/ogimet_hourly.Rd | 3 +++ man/spheroid_dist.Rd | 6 +++--- man/test_url.Rd | 9 +++++++-- 39 files changed, 83 insertions(+), 65 deletions(-) delete mode 100644 man/clean_metadata_hydro.Rd delete mode 100644 man/clean_metadata_meteo.Rd diff --git a/R/check_locale.R b/R/check_locale.R index 25532845..1a5a552e 100644 --- a/R/check_locale.R +++ b/R/check_locale.R @@ -6,6 +6,8 @@ #' in the Polish metservice's repository and therefore will be forced to #' use ASCII//TRANSLIT #' @noRd +#' @keywords internal +#' @return 1 if the locale is not UTF-8, 0 otherwise check_locale = function() { diff --git a/R/clean_metadata_hydro.R b/R/clean_metadata_hydro.R index 740d7748..dda531cc 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 +#' @noRd clean_metadata_hydro = function(address, interval) { temp = tempfile() diff --git a/R/clean_metadata_meteo.R b/R/clean_metadata_meteo.R index d721b2ef..7a5aac99 100644 --- a/R/clean_metadata_meteo.R +++ b/R/clean_metadata_meteo.R @@ -8,16 +8,12 @@ #' @importFrom stats na.omit #' @importFrom stringi stri_trans_general #' @keywords internal -#' +#' @noRd clean_metadata_meteo = function(address, rank = "synop", interval = "hourly") { temp = tempfile() test_url(link = address, output = temp) - - # a = readLines(temp, warn = FALSE, encoding = "CP1250") # doesn't work on mac, - # thus: - # a = iconv(a, from = "CP1250", to = "ASCII//TRANSLIT") a = read.csv(temp, header = FALSE, stringsAsFactors = FALSE, fileEncoding = "CP1250")$V1 a = gsub(a, pattern = "\\?", replacement = "") @@ -27,9 +23,6 @@ clean_metadata_meteo = function(address, rank = "synop", interval = "hourly") { a = gsub(x = a, pattern = "'", replacement = "") a = gsub(x = a, pattern = "\\^0", replacement = "") a = data.frame(V1 = a[nchar(a) > 3], stringsAsFactors = FALSE) - # this one does not work on windows - # a = suppressWarnings(na.omit(read.fwf(address, widths = c(1000), - # fileEncoding = "CP1250", stringsAsFactors = FALSE))) length_char = max(nchar(a$V1), na.rm = TRUE) if (rank == "precip" && interval == "hourly") length_char = 40 # exception for precip / hourly diff --git a/R/co2_demo.R b/R/co2_demo.R index 16272752..f5a6ea76 100644 --- a/R/co2_demo.R +++ b/R/co2_demo.R @@ -7,6 +7,7 @@ #' @docType data #' @keywords datasets meteo #' @examples +#' @returns data.frame with historical CO2 concentrations #' data(co2_demo) #' head(co2_demo) "co2_demo" diff --git a/R/hydro_imgw.R b/R/hydro_imgw.R index b3670e40..5cc0ffb9 100644 --- a/R/hydro_imgw.R +++ b/R/hydro_imgw.R @@ -21,7 +21,7 @@ #' @return A data.frame with columns describing the hydrological parameters #' (e.g. flow, water level) where each row represent a measurement, #' depending on the interval, at a given hour, month or year. -#' If `coords = TRUE` additional two columns with geografic coordinates are added. +#' If `coords = TRUE` additional two columns with geographic coordinates are added. #' @examples #' \donttest{ #' x = hydro_imgw("monthly", year = 1999) diff --git a/R/hydro_imgw_annual.R b/R/hydro_imgw_annual.R index 3ee96a0f..5557792b 100644 --- a/R/hydro_imgw_annual.R +++ b/R/hydro_imgw_annual.R @@ -18,6 +18,7 @@ #' @importFrom utils download.file unzip read.csv #' @importFrom data.table fread #' @export +#' @returns data.frame with historical hydrological data for the semi-annual and annual period #' @examples #' \donttest{ #' hydro_yearly = hydro_imgw_annual(year = 2000, value = "H", station = "ANNOPOL") diff --git a/R/hydro_imgw_daily.R b/R/hydro_imgw_daily.R index 4c057ccc..f9e48cef 100644 --- a/R/hydro_imgw_daily.R +++ b/R/hydro_imgw_daily.R @@ -16,7 +16,7 @@ #' @importFrom utils download.file unzip read.csv #' @importFrom data.table fread #' @export -#' +#' @returns data.frame with historical hydrological data for the daily time interval #' @examples \donttest{ #' daily = hydro_imgw_daily(year = 2000) #' } diff --git a/R/hydro_imgw_monthly.R b/R/hydro_imgw_monthly.R index 897f2dfe..cacb8291 100644 --- a/R/hydro_imgw_monthly.R +++ b/R/hydro_imgw_monthly.R @@ -16,6 +16,7 @@ #' @importFrom utils download.file unzip read.csv #' @importFrom data.table fread #' @export +#' @returns data.frame with historical hydrological data for the monthly summaries #' #' @examples \donttest{ #' monthly = hydro_imgw_monthly(year = 2000) diff --git a/R/hydro_shortening_imgw.R b/R/hydro_shortening_imgw.R index daa56455..e4bfeac7 100644 --- a/R/hydro_shortening_imgw.R +++ b/R/hydro_shortening_imgw.R @@ -10,6 +10,7 @@ #' @param remove_duplicates whether to remove duplicated column names #' (default TRUE - i.e., columns with duplicated names are deleted) #' @export +#' @returns data.frame with shorten names of hydrological parameters #' @examples #' \donttest{ #' monthly = data = hydro_imgw("monthly", year = 1969, col_names = "polish") diff --git a/R/meteo_imgw_daily.R b/R/meteo_imgw_daily.R index 36461d34..b3ee431c 100644 --- a/R/meteo_imgw_daily.R +++ b/R/meteo_imgw_daily.R @@ -20,6 +20,7 @@ #' @importFrom XML readHTMLTable #' @importFrom utils download.file unzip read.csv #' @importFrom data.table fread +#' @returns data.frame with a daily meteorological measurements #' @export #' #' @examples \donttest{ diff --git a/R/meteo_imgw_datastore.R b/R/meteo_imgw_datastore.R index 649429b9..b864eaba 100644 --- a/R/meteo_imgw_datastore.R +++ b/R/meteo_imgw_datastore.R @@ -29,7 +29,7 @@ #' @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 #' @import data.table #' @export -#' +#' @returns data.frame with a raw meteorological measurements in 10-min intervals #' @examples #' \donttest{ #' imgw_telemetry = meteo_imgw_datastore(year = 2022:2023, diff --git a/R/meteo_imgw_hourly.R b/R/meteo_imgw_hourly.R index 026c5de0..380a5630 100644 --- a/R/meteo_imgw_hourly.R +++ b/R/meteo_imgw_hourly.R @@ -20,6 +20,7 @@ #' @importFrom utils download.file unzip read.csv #' @importFrom data.table fread #' @export +#' @return meteorological data for the hourly time interval #' #' @examples \donttest{ #' hourly = meteo_imgw_hourly(rank = "climate", year = 1984) diff --git a/R/meteo_imgw_monthly.R b/R/meteo_imgw_monthly.R index a792a0d5..bf3607a9 100644 --- a/R/meteo_imgw_monthly.R +++ b/R/meteo_imgw_monthly.R @@ -23,6 +23,7 @@ #' @importFrom utils unzip read.csv #' @importFrom data.table fread #' @export +#' @return meteorological data with monthly summaries #' #' @examples #' \donttest{ diff --git a/R/meteo_noaa_co2.R b/R/meteo_noaa_co2.R index ed321c1e..ba242aee 100644 --- a/R/meteo_noaa_co2.R +++ b/R/meteo_noaa_co2.R @@ -34,6 +34,7 @@ #' @importFrom utils read.table #' @importFrom utils data #' @export +#' @returns Data frame with historical CO2 concentrations #' #' @examples #' \donttest{ diff --git a/R/meteo_noaa_hourly.R b/R/meteo_noaa_hourly.R index 7279c1e1..b34a201f 100644 --- a/R/meteo_noaa_hourly.R +++ b/R/meteo_noaa_hourly.R @@ -11,6 +11,7 @@ #' @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 utils download.file unzip read.csv #' @export +#' @returns data.frame with historical meteorological data in hourly intervals #' #' @examples #' \donttest{ diff --git a/R/meteo_shortening_imgw.R b/R/meteo_shortening_imgw.R index 9d41c687..4f0fdbfd 100644 --- a/R/meteo_shortening_imgw.R +++ b/R/meteo_shortening_imgw.R @@ -6,6 +6,7 @@ #' @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 remove_duplicates whether to remove duplicated column names (default TRUE - i.e., columns with duplicated names are deleted) #' @export +#' @returns data.frame with modified names of meteorological parameters #' #' @examples #' \donttest{ diff --git a/R/ogimet_daily.R b/R/ogimet_daily.R index b72d6416..8c0d4033 100644 --- a/R/ogimet_daily.R +++ b/R/ogimet_daily.R @@ -12,6 +12,7 @@ #' @importFrom utils setTxtProgressBar txtProgressBar #' #' @export +#' @returns data.frame with historical meteorological data for the daily summaries #' #' @examples #' \donttest{ diff --git a/R/ogimet_hourly.R b/R/ogimet_hourly.R index f421d874..dc19a417 100644 --- a/R/ogimet_hourly.R +++ b/R/ogimet_hourly.R @@ -12,6 +12,7 @@ #' @export #' #' @keywords internal +#' @returns data.frame with historical meteorological data for hourly time interval #' #' @examples #' \donttest{ diff --git a/R/spheroid_dist.R b/R/spheroid_dist.R index 3696f680..b577cdb0 100644 --- a/R/spheroid_dist.R +++ b/R/spheroid_dist.R @@ -7,12 +7,11 @@ #' @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 numerical vector with distance between two locations (in kilometers) #' @export - #' @examples -#' p1 = c(18.633333, 54.366667) # longitude and latitude for Gdansk -#' p2 = c(17.016667, 54.466667) # longitude and latitude for Slupsk +#' p1 = c(18.633333, 54.366667) # longitude and latitude for Gdansk, PL +#' p2 = c(17.016667, 54.466667) # longitude and latitude for Slupsk, PL #' spheroid_dist(p1, p2) #' spheroid_dist = function(p1, p2) { diff --git a/R/test_url.R b/R/test_url.R index 287f8fae..2e68f998 100644 --- a/R/test_url.R +++ b/R/test_url.R @@ -1,17 +1,19 @@ #' Download file in a graceful way #' #' Function for downloading & testing url/internet connection according to CRAN policy -#' Example solution strongly based on https://community.rstudio.com/t/internet-resources-should-fail-gracefully/49199/12 +#' Example solution strongly based on +#' https://community.rstudio.com/t/internet-resources-should-fail-gracefully/49199/12 #' as suggested by kvasilopoulos #' #' @param link character vector with URL to check #' @param output character vector for output file name -#' @param quiet logical vector (TRUE or FALSE) to be passed to curl_download function. FALSE by default +#' @param quiet logical vector (TRUE or FALSE) to be passed to curl_download function. +#' FALSE by default #' #' @importFrom curl curl_download #' @importFrom curl has_internet #' @import httr -#' +#' @return No return value, called for side effects #' @export #' #' @examples @@ -25,7 +27,7 @@ test_url = function(link, output, quiet = FALSE) { - print(link) + #print(link) try_GET = function(x, ...) { tryCatch( curl::curl_download(url = link, destfile = output, mode = "wb", quiet = quiet, ...), diff --git a/man/clean_metadata_hydro.Rd b/man/clean_metadata_hydro.Rd deleted file mode 100644 index c0263114..00000000 --- a/man/clean_metadata_hydro.Rd +++ /dev/null @@ -1,17 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/clean_metadata_hydro.R -\name{clean_metadata_hydro} -\alias{clean_metadata_hydro} -\title{Hydrological metadata cleaning (IMGW-PIB data only)} -\usage{ -clean_metadata_hydro(address, interval) -} -\arguments{ -\item{address}{URL address of the metadata file} - -\item{interval}{temporal interval} -} -\description{ -Internal function for hydrological metadata cleaning -} -\keyword{internal} diff --git a/man/clean_metadata_meteo.Rd b/man/clean_metadata_meteo.Rd deleted file mode 100644 index e759e8d5..00000000 --- a/man/clean_metadata_meteo.Rd +++ /dev/null @@ -1,19 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/clean_metadata_meteo.R -\name{clean_metadata_meteo} -\alias{clean_metadata_meteo} -\title{Meteorological metadata cleaning} -\usage{ -clean_metadata_meteo(address, rank = "synop", interval = "hourly") -} -\arguments{ -\item{address}{URL address of the metadata file} - -\item{rank}{stations' rank} - -\item{interval}{temporal interval} -} -\description{ -Internal function for meteorological metadata cleaning -} -\keyword{internal} diff --git a/man/co2_demo.Rd b/man/co2_demo.Rd index 401a82b2..da6b9773 100644 --- a/man/co2_demo.Rd +++ b/man/co2_demo.Rd @@ -10,13 +10,14 @@ An object of class \code{data.frame} with 745 rows and 7 columns. \usage{ co2_demo } +\value{ +data.frame with historical CO2 concentrations +data(co2_demo) +head(co2_demo) +} \description{ The object contains pre-downloaded CO2 dataset from Mauna Loa observatory The snapshot was taken 2020/05/05. } -\examples{ -data(co2_demo) -head(co2_demo) -} \keyword{datasets} \keyword{meteo} diff --git a/man/hydro_imgw.Rd b/man/hydro_imgw.Rd index d7516d71..756fab2c 100644 --- a/man/hydro_imgw.Rd +++ b/man/hydro_imgw.Rd @@ -40,7 +40,7 @@ function that shortens column names} A data.frame with columns describing the hydrological parameters (e.g. flow, water level) where each row represent a measurement, depending on the interval, at a given hour, month or year. -If \code{coords = TRUE} additional two columns with geografic coordinates are added. +If \code{coords = TRUE} additional two columns with geographic coordinates are added. } \description{ Downloading daily, and monthly hydrological data from the measurement stations diff --git a/man/hydro_imgw_annual.Rd b/man/hydro_imgw_annual.Rd index 07af47cc..6569b09e 100644 --- a/man/hydro_imgw_annual.Rd +++ b/man/hydro_imgw_annual.Rd @@ -33,6 +33,9 @@ It accepts names (characters in CAPITAL LETTERS) or stations' IDs (numeric)} \item{...}{other parameters that may be passed to the 'shortening' function that shortens column names} } +\value{ +data.frame with historical hydrological data for the semi-annual and annual period +} \description{ Downloading hydrological data for the semi-annual and annual period available in the danepubliczne.imgw.pl collection diff --git a/man/hydro_imgw_daily.Rd b/man/hydro_imgw_daily.Rd index 6c776067..0de9f59b 100644 --- a/man/hydro_imgw_daily.Rd +++ b/man/hydro_imgw_daily.Rd @@ -30,6 +30,9 @@ It accepts names (characters in CAPITAL LETTERS) or stations' IDs (numeric)} \item{...}{other parameters that may be passed to the 'shortening' function that shortens column names} } +\value{ +data.frame with historical hydrological data for the daily time interval +} \description{ Downloading daily hydrological data from the danepubliczne.imgw.pl collection } diff --git a/man/hydro_imgw_monthly.Rd b/man/hydro_imgw_monthly.Rd index 34369e2c..7ec946b3 100644 --- a/man/hydro_imgw_monthly.Rd +++ b/man/hydro_imgw_monthly.Rd @@ -30,6 +30,9 @@ It accepts names (characters in CAPITAL LETTERS) or stations' IDs (numeric)} \item{...}{other parameters that may be passed to the 'shortening' function that shortens column names} } +\value{ +data.frame with historical hydrological data for the monthly summaries +} \description{ Downloading monthly hydrological data from the danepubliczne.imgw.pl collection } diff --git a/man/hydro_shortening_imgw.Rd b/man/hydro_shortening_imgw.Rd index 3853bb82..a477bbcf 100644 --- a/man/hydro_shortening_imgw.Rd +++ b/man/hydro_shortening_imgw.Rd @@ -17,6 +17,9 @@ values with shorten names, \item{remove_duplicates}{whether to remove duplicated column names (default TRUE - i.e., columns with duplicated names are deleted)} } +\value{ +data.frame with shorten names of hydrological parameters +} \description{ Shortening column names of hydrological parameters to improve the readability of downloaded dataset from the danepubliczne.imgw.pl collection and removing duplicated column names diff --git a/man/meteo_imgw_daily.Rd b/man/meteo_imgw_daily.Rd index 718bb1db..21f11a5e 100644 --- a/man/meteo_imgw_daily.Rd +++ b/man/meteo_imgw_daily.Rd @@ -38,6 +38,9 @@ It accepts names (characters in CAPITAL LETTERS); Stations' IDs (numeric) are no \item{...}{other parameters that may be passed to the 'shortening' function that shortens column names} } +\value{ +data.frame with a daily meteorological measurements +} \description{ Downloading daily (meteorological) data from the SYNOP / CLIMATE / PRECIP stations available in the danepubliczne.imgw.pl collection diff --git a/man/meteo_imgw_datastore.Rd b/man/meteo_imgw_datastore.Rd index b22431ac..1bc73f87 100644 --- a/man/meteo_imgw_datastore.Rd +++ b/man/meteo_imgw_datastore.Rd @@ -43,6 +43,9 @@ Default \code{NULL} means to download data for all available stations. \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} } +\value{ +data.frame with a raw meteorological measurements in 10-min intervals +} \description{ Downloading hourly (meteorological) data from the telemetric stations available in the danepubliczne.imgw.pl/datastore collection since 2008. diff --git a/man/meteo_imgw_hourly.Rd b/man/meteo_imgw_hourly.Rd index d06f5284..286de97e 100644 --- a/man/meteo_imgw_hourly.Rd +++ b/man/meteo_imgw_hourly.Rd @@ -37,6 +37,9 @@ values with shorten names, "full" - full English description, \item{...}{other parameters that may be passed to the 'shortening' function that shortens column names} } +\value{ +meteorological data for the hourly time interval +} \description{ Downloading hourly (meteorological) data from the SYNOP / CLIMATE / PRECIP stations available in the danepubliczne.imgw.pl collection diff --git a/man/meteo_imgw_monthly.Rd b/man/meteo_imgw_monthly.Rd index f88d58e5..53583f76 100644 --- a/man/meteo_imgw_monthly.Rd +++ b/man/meteo_imgw_monthly.Rd @@ -40,6 +40,9 @@ By default set to TRUE (i.e. don't stop on error). For debugging purposes change \item{...}{other parameters that may be passed to the 'shortening' function that shortens column names} } +\value{ +meteorological data with monthly summaries +} \description{ Downloading monthly (meteorological) data from the SYNOP / CLIMATE / PRECIP stations available in the danepubliczne.imgw.pl collection diff --git a/man/meteo_noaa_co2.Rd b/man/meteo_noaa_co2.Rd index ff731286..54891214 100644 --- a/man/meteo_noaa_co2.Rd +++ b/man/meteo_noaa_co2.Rd @@ -6,6 +6,9 @@ \usage{ meteo_noaa_co2() } +\value{ +Data frame with historical CO2 concentrations +} \description{ Carbon Dioxide (CO2) monthly measurements from Mauna Loa observatory. The source file is available at: ftp://aftp.cmdl.noaa.gov/products/trends/co2/co2_mm_mlo.txt with all further details. diff --git a/man/meteo_noaa_hourly.Rd b/man/meteo_noaa_hourly.Rd index d6cce814..b9a5b2bd 100644 --- a/man/meteo_noaa_hourly.Rd +++ b/man/meteo_noaa_hourly.Rd @@ -20,6 +20,9 @@ meteo_noaa_hourly( \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} } +\value{ +data.frame with historical meteorological data in hourly intervals +} \description{ Downloading hourly (meteorological) data from the SYNOP stations available in the NOAA ISD collection. Some stations in the dataset are dated back even up to 1900. diff --git a/man/meteo_shortening_imgw.Rd b/man/meteo_shortening_imgw.Rd index 3e4436aa..df754523 100644 --- a/man/meteo_shortening_imgw.Rd +++ b/man/meteo_shortening_imgw.Rd @@ -13,6 +13,9 @@ meteo_shortening_imgw(data, col_names = "short", remove_duplicates = TRUE) \item{remove_duplicates}{whether to remove duplicated column names (default TRUE - i.e., columns with duplicated names are deleted)} } +\value{ +data.frame with modified names of meteorological parameters +} \description{ Shortening column names of meteorological parameters to improve the readability of downloaded dataset from the danepubliczne.imgw.pl collection and removing duplicated column names } diff --git a/man/ogimet_daily.Rd b/man/ogimet_daily.Rd index 7e2d50af..c2637a7c 100644 --- a/man/ogimet_daily.Rd +++ b/man/ogimet_daily.Rd @@ -23,6 +23,9 @@ ogimet_daily( \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} } +\value{ +data.frame with historical meteorological data for the daily summaries +} \description{ Downloading daily (meteorological) data from the Synop stations available in the https://www.ogimet.com/ repository. The data are processed only if temperature or precipitation fields are present. diff --git a/man/ogimet_hourly.Rd b/man/ogimet_hourly.Rd index 08ceac2a..1da7b405 100644 --- a/man/ogimet_hourly.Rd +++ b/man/ogimet_hourly.Rd @@ -23,6 +23,9 @@ ogimet_hourly( \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} } +\value{ +data.frame with historical meteorological data for hourly time interval +} \description{ Downloading hourly (meteorological) data from the Synop stations available in the https://www.ogimet.com/ repository } diff --git a/man/spheroid_dist.Rd b/man/spheroid_dist.Rd index 5ad75e15..ce4ba6a3 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) +numerical vector with distance between two locations (in kilometers) } \description{ Calculate the distance between two points on the surface of a spheroid @@ -20,8 +20,8 @@ using Vincenty's formula. This function can be used when GIS libraries for calculating distance are not available. } \examples{ - p1 = c(18.633333, 54.366667) # longitude and latitude for Gdansk - p2 = c(17.016667, 54.466667) # longitude and latitude for Slupsk + p1 = c(18.633333, 54.366667) # longitude and latitude for Gdansk, PL + p2 = c(17.016667, 54.466667) # longitude and latitude for Slupsk, PL spheroid_dist(p1, p2) } diff --git a/man/test_url.Rd b/man/test_url.Rd index 44c4ed2a..b0e9db07 100644 --- a/man/test_url.Rd +++ b/man/test_url.Rd @@ -11,11 +11,16 @@ test_url(link, output, quiet = FALSE) \item{output}{character vector for output file name} -\item{quiet}{logical vector (TRUE or FALSE) to be passed to curl_download function. FALSE by default} +\item{quiet}{logical vector (TRUE or FALSE) to be passed to curl_download function. +FALSE by default} +} +\value{ +No return value, called for side effects } \description{ Function for downloading & testing url/internet connection according to CRAN policy -Example solution strongly based on https://community.rstudio.com/t/internet-resources-should-fail-gracefully/49199/12 +Example solution strongly based on +https://community.rstudio.com/t/internet-resources-should-fail-gracefully/49199/12 as suggested by kvasilopoulos } \examples{