diff --git a/DESCRIPTION b/DESCRIPTION index b69e631..47f63a0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: hydroscoper Type: Package Title: Interface to the Greek National Data Bank for Hydrometeorological Information -Version: 1.6.0 +Version: 1.7.0 Authors@R: c(person("Konstantinos", "Vantas", role = c("aut", "cre"), email = "kon.vantas@gmail.com", @@ -24,15 +24,14 @@ Depends: R (>= 3.4) License: MIT + file LICENSE Encoding: UTF-8 LazyData: true -RoxygenNote: 7.3.0 +RoxygenNote: 7.3.2 Imports: stringi (>= 1.8), stringr (>= 1.5), tibble(>= 3.2), - pingr (>= 2.0), readr (>= 2.1), jsonlite (>= 1.8) Suggests: - ggplot2 (>= 3.4), + ggplot2 (>= 3.5), knitr (>= 1.45), rmarkdown (>= 2.25), testthat (>= 3.2) diff --git a/NEWS.md b/NEWS.md index 67deb67..e27ca15 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# hydroscoper 1.7.0 (Release date: 2024-07-19) + +* remove pingr dependency + # hydroscoper 1.6.0 (Release date: 2024-01-15) * Update dependencies diff --git a/R/utils.R b/R/utils.R index 13f0bff..752e78d 100644 --- a/R/utils.R +++ b/R/utils.R @@ -4,30 +4,29 @@ server_address <- function(subdomain) { paste0(subdomain, ".hydroscope.gr") } -#' Ping a remote server to see if its alive +#' Check if a remote server is alive #' @noRd server_alive <- function(subdomain) { + err_msg <- paste( "The server for that data source is probably down,", "get more info at hydroscope@hydroscope.gr or try", "again later." ) - tryCatch({ - pingr::ping_port(server_address(subdomain), - port = 80L, - count = 1 - ) - if (all(is.na(pingr::ping_port(server_address(subdomain), - port = 80L, - count = 3 - )))) { - stop() - } - }, - error = function(e) { - stop(err_msg, call. = FALSE) + + # test the http capabilities of the current R build + if (!capabilities(what = "http/ftp")) { + stop("The current R build has no http capabilities") } - ) + + # test connection by trying to read first line of url + test <- try(suppressWarnings(readLines(url, n = 1)), silent = TRUE) + + # return FALSE if test inherits 'try-error' class + if (inherits(test, "try-error")) { + stop(err_msg) + } + } #' create coords from points diff --git a/README.Rmd b/README.Rmd index 70dc1ff..b39a568 100644 --- a/README.Rmd +++ b/README.Rmd @@ -15,22 +15,28 @@ knitr::opts_chunk$set( chk_online <- FALSE -library(pingr) - # helper function to check if a sub-domain is online -online <- function(h_url){ - !is.na(pingr::ping(h_url, count = 1)) +online <- function(url = "kyy.hydroscope.gr") { + + # test the http capabilities of the current R build + if (!capabilities(what = "http/ftp")) return(FALSE) + + # test connection by trying to read first line of url + test <- try(suppressWarnings(readLines(url, n = 1)), silent = TRUE) + + # return FALSE if test inherits 'try-error' class + !inherits(test, "try-error") } # check if sub-domains are online -chk_online <- online("kyy.hydroscope.gr") +chk_online <- online() ``` [![tic](https://github.com/ropensci/hydroscoper/workflows/tic/badge.svg?branch=master)](https://github.com/ropensci/hydroscoper/actions) [![codecov](https://codecov.io/github/ropensci/hydroscoper/branch/master/graphs/badge.svg)](https://app.codecov.io/gh/ropensci/hydroscoper) [![minimal R version](https://img.shields.io/badge/R%3E%3D-3.4-6666ff.svg)](https://cran.r-project.org/) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/hydroscoper)](https://cran.r-project.org/package=hydroscoper) -[![packageversion](https://img.shields.io/badge/Package%20version-1.6.0-orange.svg?style=flat-square)](https://github.com/ropensci/hydroscoper) +[![packageversion](https://img.shields.io/badge/Package%20version-1.7.0-orange.svg?style=flat-square)](https://github.com/ropensci/hydroscoper) [![](https://cranlogs.r-pkg.org/badges/grand-total/hydroscoper)](https://cran.r-project.org/package=hydroscoper) [![ropensci](https://badges.ropensci.org/185_status.svg)](https://github.com/ropensci/software-review/issues/185) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1196540.svg)](https://doi.org/10.5281/zenodo.1196540) diff --git a/README.md b/README.md index ee1b433..eed06a9 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ hydroscoper [![minimal R version](https://img.shields.io/badge/R%3E%3D-3.4-6666ff.svg)](https://cran.r-project.org/) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/hydroscoper)](https://cran.r-project.org/package=hydroscoper) -[![packageversion](https://img.shields.io/badge/Package%20version-1.6.0-orange.svg?style=flat-square)](https://github.com/ropensci/hydroscoper) +[![packageversion](https://img.shields.io/badge/Package%20version-1.7.0-orange.svg?style=flat-square)](https://github.com/ropensci/hydroscoper) [![](https://cranlogs.r-pkg.org/badges/grand-total/hydroscoper)](https://cran.r-project.org/package=hydroscoper) [![ropensci](https://badges.ropensci.org/185_status.svg)](https://github.com/ropensci/software-review/issues/185) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1196540.svg)](https://doi.org/10.5281/zenodo.1196540) @@ -75,20 +75,6 @@ library(ggplot2) ts_raw <- get_data(subdomain = "kyy", time_id = 56) ts_raw -#> # A tibble: 147,519 × 3 -#> date value comment -#> -#> 1 1985-05-06 08:00:00 0 1 -#> 2 1985-05-06 08:30:00 0 1 -#> 3 1985-05-06 09:00:00 0 1 -#> 4 1985-05-06 09:30:00 0 1 -#> 5 1985-05-06 10:00:00 0 1 -#> 6 1985-05-06 10:30:00 0 1 -#> 7 1985-05-06 11:00:00 0 1 -#> 8 1985-05-06 11:30:00 0 1 -#> 9 1985-05-06 12:00:00 0 1 -#> 10 1985-05-06 12:30:00 0 1 -#> # ℹ 147,509 more rows ``` Let’s create a plot: @@ -101,8 +87,6 @@ ggplot(data = ts_raw, aes(x = date, y = value))+ theme_classic() ``` -![](man/figures/README-plot_time_series-1.png) - ## Meta - Bug reports, suggestions, and code are welcome. Please see diff --git a/codemeta.json b/codemeta.json index c8781e9..bef1a20 100644 --- a/codemeta.json +++ b/codemeta.json @@ -4,23 +4,17 @@ "identifier": "hydroscoper", "description": "R interface to the Greek National Data Bank for Hydrological and Meteorological Information. It covers Hydroscope's data sources and provides functions to transliterate, translate and download them into tidy dataframes.", "name": "hydroscoper: Interface to the Greek National Data Bank for Hydrometeorological Information", - "relatedLink": ["https://docs.ropensci.org/hydroscoper/", "https://CRAN.R-project.org/package=hydroscoper"], + "relatedLink": "https://docs.ropensci.org/hydroscoper/", "codeRepository": "https://github.com/ropensci/hydroscoper", "issueTracker": "https://github.com/ropensci/hydroscoper/issues ", "license": "https://spdx.org/licenses/MIT", - "version": "1.5.0", + "version": "1.7.0", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", "url": "https://r-project.org" }, - "runtimePlatform": "R version 4.2.1 (2022-06-23)", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, + "runtimePlatform": "R version 4.4.1 (2024-06-14 ucrt)", "author": [ { "@type": "Person", @@ -51,7 +45,7 @@ "@type": "SoftwareApplication", "identifier": "ggplot2", "name": "ggplot2", - "version": ">= 3.3", + "version": ">= 3.5", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -64,7 +58,7 @@ "@type": "SoftwareApplication", "identifier": "knitr", "name": "knitr", - "version": ">= 1.31", + "version": ">= 1.45", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -77,7 +71,7 @@ "@type": "SoftwareApplication", "identifier": "rmarkdown", "name": "rmarkdown", - "version": ">= 2.7", + "version": ">= 2.25", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -90,7 +84,7 @@ "@type": "SoftwareApplication", "identifier": "testthat", "name": "testthat", - "version": ">= 3.0", + "version": ">= 3.2", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -111,7 +105,7 @@ "@type": "SoftwareApplication", "identifier": "stringi", "name": "stringi", - "version": ">= 1.5", + "version": ">= 1.8", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -124,7 +118,7 @@ "@type": "SoftwareApplication", "identifier": "stringr", "name": "stringr", - "version": ">= 1.4", + "version": ">= 1.5", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -137,7 +131,7 @@ "@type": "SoftwareApplication", "identifier": "tibble", "name": "tibble", - "version": ">= 3.1", + "version": ">= 3.2", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -147,23 +141,10 @@ "sameAs": "https://CRAN.R-project.org/package=tibble" }, "5": { - "@type": "SoftwareApplication", - "identifier": "pingr", - "name": "pingr", - "version": ">= 2.0", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=pingr" - }, - "6": { "@type": "SoftwareApplication", "identifier": "readr", "name": "readr", - "version": ">= 1.4", + "version": ">= 2.1", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -172,11 +153,11 @@ }, "sameAs": "https://CRAN.R-project.org/package=readr" }, - "7": { + "6": { "@type": "SoftwareApplication", "identifier": "jsonlite", "name": "jsonlite", - "version": ">= 1.7", + "version": ">= 1.8", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -187,7 +168,7 @@ }, "SystemRequirements": null }, - "fileSize": "534.714KB", + "fileSize": "510.698KB", "citation": [ { "@type": "ScholarlyArticle", @@ -216,10 +197,12 @@ } ], "releaseNotes": "https://github.com/ropensci/hydroscoper/blob/master/NEWS.md", - "contIntegration": ["https://travis-ci.org/ropensci/hydroscoper", "https://ci.appveyor.com/project/ropensci/hydroscoper", "https://codecov.io/gh/ropensci/hydroscoper"], + "readme": "https://github.com/ropensci/hydroscoper/blob/master/README.md", + "contIntegration": ["https://github.com/ropensci/hydroscoper/actions", "https://app.codecov.io/gh/ropensci/hydroscoper"], "review": { "@type": "Review", "url": "https://github.com/ropensci/software-review/issues/185", "provider": "https://ropensci.org" - } + }, + "keywords": ["climate", "hydroscope", "hydrometeorology", "hydrology", "tidy-data", "time-series", "greece", "water-resources", "meteorological-stations", "meteorological-data", "r", "rstats", "r-package", "peer-reviewed"] } diff --git a/docs/404.html b/docs/404.html index dc3a712..ddb5325 100644 --- a/docs/404.html +++ b/docs/404.html @@ -6,7 +6,7 @@ Page not found (404) • hydroscoper - + @@ -18,7 +18,7 @@ - +
@@ -44,7 +44,7 @@
- +
@@ -103,16 +103,16 @@

Page not found (404)

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/CONDUCT.html b/docs/CONDUCT.html index 67dbf60..be00ff4 100644 --- a/docs/CONDUCT.html +++ b/docs/CONDUCT.html @@ -1,9 +1,9 @@ -Contributor Code of Conduct • hydroscoperContributor Code of Conduct • hydroscoper - +
@@ -28,7 +28,7 @@
- +
@@ -84,15 +84,15 @@

Contributor Code of Conduct

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/CONTRIBUTING.html b/docs/CONTRIBUTING.html index 125b884..d5048ea 100644 --- a/docs/CONTRIBUTING.html +++ b/docs/CONTRIBUTING.html @@ -1,9 +1,9 @@ -Suggestions and bug reports • hydroscoperSuggestions and bug reports • hydroscoper - +
@@ -28,7 +28,7 @@
- +
@@ -93,15 +93,15 @@

Contributing -

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 0aff65d..8e60241 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -1,9 +1,9 @@ -License • hydroscoperLicense • hydroscoper - +
@@ -28,7 +28,7 @@
- +
@@ -78,15 +78,15 @@

License

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 1ed41cf..1249b69 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -1,9 +1,9 @@ -MIT License • hydroscoperMIT License • hydroscoper - +
@@ -28,7 +28,7 @@
- +
@@ -82,15 +82,15 @@

MIT License

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/articles/index.html b/docs/articles/index.html index f1764ed..db167fb 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -1,9 +1,9 @@ -Articles • hydroscoperArticles • hydroscoper - +
@@ -28,7 +28,7 @@
- +
@@ -77,15 +77,15 @@

All vignettes

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/articles/intro_hydroscoper.html b/docs/articles/intro_hydroscoper.html index a53f045..0e4dc35 100644 --- a/docs/articles/intro_hydroscoper.html +++ b/docs/articles/intro_hydroscoper.html @@ -6,20 +6,19 @@ An introduction to `hydroscoper` • hydroscoper - + - - +
@@ -45,7 +44,7 @@
- +
@@ -86,7 +85,7 @@

An introduction to hydroscoper

Konstantinos Vantas

-

2024-01-15

+

2024-07-19

Source: vignettes/intro_hydroscoper.Rmd @@ -278,7 +277,8 @@

Example color = "#E64B35FF") + coord_fixed(ratio=1) + theme_bw() -#> Warning: Removed 11 rows containing missing values (`geom_point()`).

+#> Warning: Removed 11 rows containing missing values or values outside the scale range +#> (`geom_point()`).

To get the time series’ data for the station 200200 we can use:

@@ -303,9 +303,7 @@

Example - - + @@ -318,16 +316,16 @@

Example

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/articles/stations_with_data.html b/docs/articles/stations_with_data.html index 802a4cb..c3bc6a7 100644 --- a/docs/articles/stations_with_data.html +++ b/docs/articles/stations_with_data.html @@ -6,20 +6,19 @@ Using `hydroscoper`'s data • hydroscoper - + - - +
@@ -45,7 +44,7 @@
- +
@@ -85,7 +84,7 @@

Using hydroscoper’s data

Konstantinos Vantas

-

2024-01-15

+

2024-07-19

Source: vignettes/stations_with_data.Rmd @@ -166,7 +165,8 @@

Stations location"#3C5488FF"))+ coord_fixed(ratio=1) + theme_bw() -#> Warning: Removed 120 rows containing missing values (`geom_point()`).

+#> Warning: Removed 120 rows containing missing values or values outside the scale range +#> (`geom_point()`).

@@ -189,7 +189,8 @@

Stations with available time series scale_color_manual(values=c("#00A087FF", "#3C5488FF"))+ coord_fixed(ratio=1) + theme_bw() -#> Warning: Removed 10 rows containing missing values (`geom_point()`).

+#> Warning: Removed 10 rows containing missing values or values outside the scale range +#> (`geom_point()`).

Although there is a large number of stations with available data, there is heterogeneity in the coverage of the country.

@@ -198,9 +199,7 @@

Stations with available time series + @@ -213,16 +212,16 @@

Stations with available time series

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/authors.html b/docs/authors.html index dda606d..4bb28a6 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,9 +1,9 @@ -Authors and Citation • hydroscoperAuthors and Citation • hydroscoper - +
@@ -28,7 +28,7 @@
- +
- +
  • Konstantinos Vantas. Author, maintainer.

  • -

    Sharla Gelfand. Contributor, reviewer. +

    Sharla Gelfand. Contributor, reviewer.
    Sharla Gelfand reviewed the package for rOpenSci, see https://github.com/ropensci/onboarding/issues/185

  • -

    Tim Trice. Reviewer. +

    Tim Trice. Reviewer.
    Tim Trice reviewed the package for rOpenSci, see https://github.com/ropensci/onboarding/issues/185

@@ -106,15 +106,15 @@

Citation

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/index.html b/docs/index.html index b016cdd..5e781b0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,23 +6,20 @@ Interface to the Greek National Data Bank for Hydrometeorological Information • hydroscoper - + - + - +
@@ -48,7 +45,7 @@
- +
@@ -87,7 +84,7 @@ -

tic codecov minimal R version CRAN_Status_Badge packageversion ropensci DOI DOI

+

tic codecov minimal R version CRAN_Status_Badge packageversion ropensci DOI DOI

hydroscoper is an R interface to the Greek National Data Bank for Hydrological and Meteorological Information, Hydroscope. For more details checkout the package’s website and the vignettes:

    @@ -143,21 +140,7 @@

    Examplelibrary(ggplot2) ts_raw <- get_data(subdomain = "kyy", time_id = 56) -ts_raw -#> # A tibble: 147,519 × 3 -#> date value comment -#> <dttm> <dbl> <chr> -#> 1 1985-05-06 08:00:00 0 1 -#> 2 1985-05-06 08:30:00 0 1 -#> 3 1985-05-06 09:00:00 0 1 -#> 4 1985-05-06 09:30:00 0 1 -#> 5 1985-05-06 10:00:00 0 1 -#> 6 1985-05-06 10:30:00 0 1 -#> 7 1985-05-06 11:00:00 0 1 -#> 8 1985-05-06 11:30:00 0 1 -#> 9 1985-05-06 12:00:00 0 1 -#> 10 1985-05-06 12:30:00 0 1 -#> # ℹ 147,509 more rows

+ts_raw

Let’s create a plot:

 ggplot(data = ts_raw, aes(x = date, y = value))+
@@ -165,7 +148,6 @@ 

Example labs(title= "30 min precipitation for station 200200", x="Date", y = "Rain height (mm)")+ theme_classic()

-

Meta @@ -253,16 +235,16 @@

Developers

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/news/index.html b/docs/news/index.html index ab83e1b..e6eab95 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -1,9 +1,9 @@ -Changelog • hydroscoperChangelog • hydroscoper - +
@@ -28,7 +28,7 @@
- +
@@ -60,6 +60,14 @@

Changelog

Source: NEWS.md
+
+ +
  • remove pingr dependency
  • +
+
+ +
  • Update dependencies
  • +
  • remove defunct functions
  • @@ -167,15 +175,15 @@
- - + + diff --git a/docs/paper.html b/docs/paper.html index 53d76d4..03eeb43 100644 --- a/docs/paper.html +++ b/docs/paper.html @@ -1,9 +1,9 @@ -Summary • hydroscoperSummary • hydroscoper - +
@@ -28,7 +28,7 @@
- +
@@ -87,15 +87,15 @@

References -

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index a185b5c..70612d1 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,8 +1,7 @@ -pandoc: 3.1.1 -pkgdown: 2.0.7 +pandoc: 3.1.11 +pkgdown: 2.1.0 pkgdown_sha: ~ articles: intro_hydroscoper: intro_hydroscoper.html stations_with_data: stations_with_data.html -last_built: 2024-01-15T11:00Z - +last_built: 2024-07-19T05:35Z diff --git a/docs/reference/find_stations.html b/docs/reference/find_stations.html index 3604c08..bebb65c 100644 --- a/docs/reference/find_stations.html +++ b/docs/reference/find_stations.html @@ -1,11 +1,11 @@ -Find nearest stations using a point's coordinates — find_stations • hydroscoperFind nearest stations using a point's coordinates — find_stations • hydroscoper - +
@@ -30,7 +30,7 @@
- +
@@ -75,19 +75,19 @@

Find nearest stations using a point's coordinates

Arguments

-
longitude
+ + +
longitude

a numeric value in degrees

-
latitude
+
latitude

a numeric value in degrees

Value

- - -

If the given longitude is in [24, 38] and the latitude is in [34, 42] +

If the given longitude is in [24, 38] and the latitude is in [34, 42] (i.e. are valid values for Greece) returns an ordered tibble with the station_id, name, subdomain and distance values in km. The station's data that are used come from the `stations` dataset. Otherwise returns an error @@ -122,15 +122,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/get_data.html b/docs/reference/get_data.html index 7e7bde5..fc34568 100644 --- a/docs/reference/get_data.html +++ b/docs/reference/get_data.html @@ -1,10 +1,10 @@ -Get time series values in a tibble — get_data • hydroscoperGet time series values in a tibble — get_data • hydroscoper - +
@@ -29,7 +29,7 @@
- +
@@ -73,26 +73,24 @@

Get time series values in a tibble

Arguments

-
subdomain
+ + +
subdomain

One of the subdomains of hydroscope.gr

-
time_id
+
time_id

A time series ID

Value

- - -

If subdomain is one of:

  • kyy, Ministry of Environment and Energy

  • +

    If subdomain is one of:

    • kyy, Ministry of Environment and Energy

    • ypaat, Ministry of Rural Development and Food

    • deh, Greek Public Power Corporation

    • emy, National Meteorological Service

    and time_id exists in that subdomain, returns a tibble with the time series values. Otherwise returns an error message.

    - -

    The dataframe columns are:

    date

    The time series Dates (POSIXct)

    @@ -123,10 +121,10 @@

    Author

    Examples

    -
    if (FALSE) {
    +    
    if (FALSE) { # \dontrun{
     # get time series 912 from the Greek Ministry of Environment and Energy
     time_series <- get_data("kyy", 912)
    -}
    +} # }
     
     
    @@ -142,15 +140,15 @@

    Examples

    -

    Site built with pkgdown 2.0.7.

    +

    Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/get_tables.html b/docs/reference/get_tables.html index 29d094e..b5d4066 100644 --- a/docs/reference/get_tables.html +++ b/docs/reference/get_tables.html @@ -1,11 +1,11 @@ -Get tibbles from Hydroscope — get_tables • hydroscoperGet tibbles from Hydroscope — get_tables • hydroscoper - +
@@ -30,7 +30,7 @@
- +
@@ -111,20 +111,20 @@

Get tibbles from Hydroscope

Arguments

-
subdomain
+ + +
subdomain

One of the subdomains of Hydroscope in the vector c("kyy", "ypaat", "emy", "deh").

-
translit
+
translit

Automatically transliterate Greek to Latin.

Value

- - -

If subdomain is one of:

  • kyy, Ministry of Environment and Energy.

  • +

    If subdomain is one of:

    • kyy, Ministry of Environment and Energy.

    • ypaat, Ministry of Rural Development and Food.

    • deh, Greek Public Power Corporation.

    • emy, National Meteorological Service.

    • @@ -154,7 +154,7 @@

      Author

      Examples

      
      -if (FALSE) {
      +if (FALSE) { # \dontrun{
       
       # data will be downloaded from Ministry of Environment and Energy (kyy):
       subdomain <- "kyy"
      @@ -197,7 +197,7 @@ 

      Examples

      # use all the get_ functions above to create a named list with tibbles kyy_db <- get_database(subdomain) -} +} # }
      @@ -213,15 +213,15 @@

      Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/greece_borders.html b/docs/reference/greece_borders.html index 95b8d49..da58350 100644 --- a/docs/reference/greece_borders.html +++ b/docs/reference/greece_borders.html @@ -1,11 +1,11 @@ -Greek borders — greece_borders • hydroscoperGreek borders — greece_borders • hydroscoper - +
@@ -30,7 +30,7 @@
- +
@@ -112,15 +112,15 @@

Source

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/hydro_coords.html b/docs/reference/hydro_coords.html index a3a3cfc..3a1329d 100644 --- a/docs/reference/hydro_coords.html +++ b/docs/reference/hydro_coords.html @@ -1,11 +1,11 @@ -Convert coordinates from Hydroscope's points to a tibble — hydro_coords • hydroscoperConvert coordinates from Hydroscope's points to a tibble — hydro_coords • hydroscoper - +
@@ -30,7 +30,7 @@
- +
@@ -75,15 +75,15 @@

Convert coordinates from Hydroscope's points to a tibble

Arguments

-
x
+ + +
x

a string vector with the points retrieved from Hydroscope

Value

- - -

a tibble with the longitude and latitude values.

+

a tibble with the longitude and latitude values.

Author

@@ -92,13 +92,13 @@

Author

Examples

-
if (FALSE) {
+    
if (FALSE) { # \dontrun{
 # get stations from the Greek Ministry of Environment and Energy
 kyy_stations <- get_stations("kyy")
 
 # create a tibble with stations' coords
 coords <- hydro_coords(kyy_stations$point)
-}
+} # }
 
@@ -113,15 +113,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/hydro_translate.html b/docs/reference/hydro_translate.html index e2e7ca9..b5b0198 100644 --- a/docs/reference/hydro_translate.html +++ b/docs/reference/hydro_translate.html @@ -1,10 +1,10 @@ -Translate Greek names and terms to English — hydro_translate • hydroscoperTranslate Greek names and terms to English — hydro_translate • hydroscoper - +
@@ -29,7 +29,7 @@
- +
@@ -73,33 +73,27 @@

Translate Greek names and terms to English

Arguments

-
x
+ + +
x

a string vector

-
value
+
value

One of the predefined values in c("owner", "variable", "timestep", "division")

Value

- - -

If value is one of:

  • owner, organizations' names.

  • +

    If value is one of:

    • owner, organizations' names.

    • variable, hydrometeorological term.

    • timestep, timestep term.

    • division, Water Division.

    returns a character vector with translations of various hydrometeorological terms or organizations' names from Greek (with latin characters) to English.

    - -

    The organizations' names in owner are:

    - -
    CodeName
    min_envir_energyMinistry of Environment and Energy
    min_agricultMinistry of Rural Development and Food
    natio_meteo_serviceNational Meteorological Service
    natio_observ_athensNational Observatory of Athens
    public_power_corpPublic Power Corporation
    natio_argic_researNational Agricultural Research Foundation
    greek_perfecturesGreek Prefectures
    crete_eng_facultyTechnical University of Crete
    crete_natural_museumNatural History Museum of Crete

    The Greek Water Divisions codes in division are:

    - -
    CodeName
    GR01Dytike Peloponnesos
    GR02Boreia Peloponnesos
    GR03Anatolike Peloponnesos
    GR04Dytike Sterea Ellada
    GR05Epeiros
    GR06Attike
    GR07Anatolike Sterea Ellada
    GR08Thessalia
    GR09Dytike Makedonia
    GR10Kentrike Makedonia
    GR11Anatolike Makedonia
    GR12Thrake
    GR13Krete
    GR14Nesoi Aigaiou

Note

@@ -108,14 +102,14 @@

Note

Examples

-
if (FALSE) {
+    
if (FALSE) { # \dontrun{
 
 # get data from the Ministry of Environment and Energy
 kyy_owners <- get_owners("kyy")
 kyy_vars <- get_variables("kyy")
 owners_names <- hydro_translate(kyy_owners$name, "owner")
 vars <- hydro_translate(kyy_vars$descr, "variable")
-}
+} # }
 
@@ -130,15 +124,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/hydroscoper.html b/docs/reference/hydroscoper.html index 62c1d65..ad1c261 100644 --- a/docs/reference/hydroscoper.html +++ b/docs/reference/hydroscoper.html @@ -1,5 +1,5 @@ -hydroscoper: Interface to Hydroscope — hydroscoper • hydroscoperhydroscoper: Interface to Hydroscope — hydroscoper • hydroscoper - +
@@ -38,7 +38,7 @@
- +
@@ -85,7 +85,7 @@

hydroscoper: Interface to Hydroscope

Enhydris API

- +

The Enhydris database is implemented in PostgreSQL. Details @@ -93,7 +93,7 @@

Enhydris API

Data Sources

- +

The data are retrieved from the Hydroscope's databases:

  • Ministry of Environment, Energy and Climate Change.

  • @@ -127,15 +127,15 @@

    Author

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/index.html b/docs/reference/index.html index 17551a1..2f1a3fd 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -1,9 +1,9 @@ -Function reference • hydroscoperPackage index • hydroscoper - +
@@ -28,7 +28,7 @@
- +
@@ -132,15 +132,15 @@

Datasets

pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/stations.html b/docs/reference/stations.html index 8b2235a..fac0a9e 100644 --- a/docs/reference/stations.html +++ b/docs/reference/stations.html @@ -1,12 +1,12 @@ -stations — stations • hydroscoperstations — stations • hydroscoper - +
@@ -31,7 +31,7 @@
- +
@@ -119,15 +119,15 @@

Format

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/timeseries.html b/docs/reference/timeseries.html index f43cdc5..3b26e6d 100644 --- a/docs/reference/timeseries.html +++ b/docs/reference/timeseries.html @@ -1,5 +1,5 @@ -timeseries — timeseries • hydroscopertimeseries — timeseries • hydroscoper - +
@@ -32,7 +32,7 @@
- +
@@ -118,15 +118,15 @@

Format

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 33502d3..830d0bf 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -1,72 +1,26 @@ - - - - /404.html - - - /articles/index.html - - - /articles/intro_hydroscoper.html - - - /articles/stations_with_data.html - - - /authors.html - - - /CONDUCT.html - - - /CONTRIBUTING.html - - - /index.html - - - /LICENSE-text.html - - - /LICENSE.html - - - /news/index.html - - - /paper.html - - - /reference/find_stations.html - - - /reference/get_data.html - - - /reference/get_tables.html - - - /reference/greece_borders.html - - - /reference/hydroscoper.html - - - /reference/hydroscoper_defunct.html - - - /reference/hydro_coords.html - - - /reference/hydro_translate.html - - - /reference/index.html - - - /reference/stations.html - - - /reference/timeseries.html - + +/404.html +/articles/index.html +/articles/intro_hydroscoper.html +/articles/stations_with_data.html +/authors.html +/CONDUCT.html +/CONTRIBUTING.html +/index.html +/LICENSE-text.html +/LICENSE.html +/news/index.html +/paper.html +/reference/find_stations.html +/reference/get_data.html +/reference/get_tables.html +/reference/greece_borders.html +/reference/hydroscoper.html +/reference/hydroscoper_defunct.html +/reference/hydro_coords.html +/reference/hydro_translate.html +/reference/index.html +/reference/stations.html +/reference/timeseries.html + diff --git a/tests/testthat/test_enhydris.R b/tests/testthat/test_enhydris.R index fa79110..676a24e 100644 --- a/tests/testthat/test_enhydris.R +++ b/tests/testthat/test_enhydris.R @@ -28,18 +28,17 @@ test_that("enhydris_url table address", { skip_if_not_online <- function(subdomain) { h_url <- paste0(subdomain, ".hydroscope.gr") - tryCatch( - expr = { - if (all(is.na(pingr::ping_port(h_url, port = 80L, count = 3)))) { - skip(paste(h_url, "is not online")) - } - }, - error = function(e){ - skip(paste("Cannot resolve host name", h_url)) - } - ) - if (all(is.na(pingr::ping_port(h_url, port = 80L, count = 3)))) { - skip(paste(h_url, "is not online")) + # test the http capabilities of the current R build + if (!capabilities(what = "http/ftp")) { + skip("The current R build has no http capabilities") + } + + # test connection by trying to read first line of url + test <- try(suppressWarnings(readLines(url, n = 1)), silent = TRUE) + + # return FALSE if test inherits 'try-error' class + if (inherits(test, "try-error")) { + skip(paste("Cannot read data from", h_url)) } }