Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.0.0 rc1 #281

Merged
merged 99 commits into from
Dec 19, 2023
Merged
Changes from 9 commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
f445d9e
Update get_eurostat_json.R
ake123 Jun 9, 2023
1adff6f
Update get_eurostat_json.R
ake123 Jun 12, 2023
4f5a54e
Update get_eurostat_json.R
ake123 Jun 13, 2023
fee43b9
Update get_eurostat_json.R
ake123 Jun 13, 2023
a86d575
Update get_eurostat_json.R
ake123 Jun 14, 2023
6614b12
Update get_eurostat_json
ake123 Jun 16, 2023
b90e669
Update get_eurostat_json.R #262
ake123 Jun 19, 2023
dcad4e1
Merge pull request #262 from ake123/master
pitkant Jun 20, 2023
d74bcb7
Rewrite get_eurostat_json error message handling
pitkant Jun 21, 2023
4bf171d
Remove references to legacy bulk download from functions and tests
pitkant Jun 21, 2023
cfdaf37
Reduce RAM usage when handling big datasets with weekly data
pitkant Jun 28, 2023
cb8ec7e
Typo fix
pitkant Jun 28, 2023
51624ad
Migrate to use giscoR
dieghernan Jul 1, 2023
20b0c32
Finish R code and actions
dieghernan Jul 2, 2023
55134fe
Update action versions
dieghernan Jul 2, 2023
3d98b72
Delete docs
dieghernan Jul 2, 2023
ad7c8c9
Update NEWS.md
dieghernan Jul 2, 2023
756cf9f
Adjust messages and tests
dieghernan Jul 3, 2023
3a6e48f
Make columns on spatial output consistent
dieghernan Jul 31, 2023
37fce83
Clarify some lines, fix typos
pitkant Jul 31, 2023
46d8a78
Merge pull request #264 from rOpenGov/gisco
pitkant Jul 31, 2023
bec9635
Silence first error message in case of errors
pitkant Aug 2, 2023
49878f8
Rewrite cache functionalities
pitkant Aug 10, 2023
f03d738
Update NAMESPACE, NEWS, DESCRIPTION
pitkant Aug 10, 2023
e2b5999
Using cache filtering only if download method is the same
pitkant Aug 11, 2023
d0df373
Add info on download date to query
pitkant Aug 11, 2023
2f1318b
Update TOC URL
pitkant Aug 11, 2023
f533daa
Add test for new filter behavior
pitkant Aug 14, 2023
19bd764
Reorder slightly for better logic
pitkant Aug 14, 2023
8fb1013
Lint code
pitkant Aug 15, 2023
3ae8337
Update get_bibentry url and replace year field with date
pitkant Aug 15, 2023
7d86040
Revert "Update get_bibentry url and replace year field with date"
pitkant Aug 16, 2023
be2b98d
Merge pull request #267 from rOpenGov/cache
pitkant Aug 17, 2023
61db0b8
Make function usable without sf package
pitkant Aug 17, 2023
e03bdbb
Merge pull request #269 from rOpenGov/cache
pitkant Aug 18, 2023
16142a3
Fix title-code mismatch, add attribution
pitkant Aug 18, 2023
ce5a500
Use c() instead of personList()
pitkant Aug 21, 2023
6efac2f
Warn user for missing items in output
pitkant Aug 22, 2023
e45fa9c
Rephrase warning messages
pitkant Aug 22, 2023
77d0b7a
Edit example, remove EC from authors
pitkant Aug 24, 2023
524c4a5
Use inheriting documentation where possible
pitkant Aug 29, 2023
cbf5ce6
Include NEWS.md to package build
pitkant Aug 29, 2023
ae46605
Add additional argument to search_eurostat()
pitkant Aug 31, 2023
9b22591
Clean TOC names by replacing empty spaces with .
pitkant Aug 31, 2023
8f23a6d
Update documentation
pitkant Aug 31, 2023
4d1f5f9
Add hierarchy column to TOC
pitkant Aug 31, 2023
a5d11bc
Add function for counting number of children in TOC
pitkant Aug 31, 2023
79e0c3a
Add function get_eurostat_folder()
pitkant Sep 1, 2023
c72f1a7
Update documentation on filtering datasets
pitkant Sep 4, 2023
65e29d3
Use new URL for Eurostat dictionaries
pitkant Sep 4, 2023
11634d6
Clarify documentation on filtering
pitkant Sep 4, 2023
d3be394
Explicit deprecation and defunct, fix label_eurostat_tables and label…
pitkant Sep 7, 2023
1fb6f28
Merge pull request #271 from rOpenGov/search_eurostat
pitkant Sep 12, 2023
7597740
Update CITATION
pitkant Sep 12, 2023
a63c141
Fix function to mitigate for changes made in set_eurostat_toc()
pitkant Sep 13, 2023
5949580
Add experimental language support to get_bibentry, fix output
pitkant Sep 14, 2023
7581895
Use check_lang function to enforce correct lang usage
pitkant Sep 15, 2023
740d36d
Test for lang parameter messages
pitkant Sep 15, 2023
1fca371
Enable searching French and German TOC objects
pitkant Sep 15, 2023
5d3d9d1
Test for multilingual search
pitkant Sep 15, 2023
4e5cc17
Test for multilingual bibentry
pitkant Sep 15, 2023
53a6bd2
Update NEWS
pitkant Sep 15, 2023
cecfdf0
Improve tests
pitkant Sep 15, 2023
0ef26d9
Remove *_multilingual functions and use only regular functions
pitkant Sep 18, 2023
0d55890
Remove redundant arguments from set_eurostat_toc
pitkant Sep 20, 2023
38bb289
Add new function: list_cache_items
pitkant Sep 21, 2023
be2de77
Add possibility of returning a list in get_eurostat_folder
pitkant Sep 21, 2023
d81d2d9
Correct journal name in textVersion
pitkant Sep 26, 2023
899963a
Check for missing cache_list.json; export function
pitkant Sep 26, 2023
8d16a39
Fix mention of hard limit in get_eurostat_folder: 10 -> 20
pitkant Sep 26, 2023
c17e0ca
Merge pull request #270 from rOpenGov/get_bibentry
pitkant Sep 27, 2023
5e2e6f3
Re-render README
pitkant Sep 27, 2023
900e433
Switch from httr to httr2
pitkant Sep 27, 2023
fb6352f
Enable proxy use in requests
pitkant Sep 28, 2023
e2598fd
Merge pull request #276 from rOpenGov/httr2
pitkant Sep 29, 2023
1e323cd
Implement data.table functions for handling big objects in memory
pitkant Sep 29, 2023
668a2d8
Update documentation
pitkant Sep 29, 2023
febbea6
Use argument header=TRUE with data.table fread
pitkant Oct 2, 2023
6ad9abb
Include example of use.data.table = TRUE in tests
pitkant Oct 3, 2023
7116503
Set TOC values column as numeric
pitkant Oct 3, 2023
2675efa
Clarify documentation
pitkant Oct 3, 2023
9786a0e
Reduce deep copying, aim to mutate by reference
pitkant Oct 5, 2023
327964a
Fix get/set_eurostat_toc and tests to better handle certain anomalies
pitkant Oct 5, 2023
c2136a9
Require always sf for get_eurostat_geospatial
dieghernan Oct 14, 2023
f68da84
Merge pull request #280 from rOpenGov/use_sf
pitkant Oct 20, 2023
6ac2007
Bump minimum supported version of R
pitkant Oct 20, 2023
cf8a251
Merge pull request #278 from rOpenGov/httr2
pitkant Oct 20, 2023
d22a905
Update test_04_get and testthat snaps
pitkant Oct 31, 2023
2173e65
Add new functions: get_eurostat_interactive and fixity_checksum
pitkant Nov 3, 2023
07d92df
Combine all 4.0.0.900* NEWS items under 4.0.0
pitkant Nov 3, 2023
386a23a
Categorise fixity_checksum under helpers
pitkant Nov 3, 2023
3f412c2
4.0.0 rc1
pitkant Nov 3, 2023
3d42882
Reorder NEWS items, add issue and PR numbers, add attribution
pitkant Nov 3, 2023
2484225
First update to vignette (article) with 4.0.0
pitkant Nov 3, 2023
041afb6
Turn fixity_checksum into internal function
pitkant Nov 6, 2023
e696b91
Merge label_eurostat_vars2 to label_eurostat_vars
pitkant Dec 19, 2023
250ce74
Update news
pitkant Dec 19, 2023
b9ff2b7
Add article explaining difference between old and new dic methods
pitkant Dec 19, 2023
f16e0d1
Merge pull request #282 from rOpenGov/update-tutorial
pitkant Dec 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

10 changes: 3 additions & 7 deletions .github/workflows/rogtemplate-gh-pages.yaml
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

@@ -34,11 +34,7 @@ jobs:
local::.
any::pkgdown
ropengov/rogtemplate
any::magick
any::tmap
any::Cairo
any::rcmdcheck
any::XML

- name: Build logo if not present and prepare template
run: |
@@ -57,6 +53,6 @@ jobs:

- name: Deploy package
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
35 changes: 17 additions & 18 deletions .github/workflows/tidy_code.yaml
Original file line number Diff line number Diff line change
@@ -16,23 +16,24 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@master
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@master
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@master
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
usethis
styler
urlchecker
devtools
roxygen2
local::.
any::usethis
any::styler
any::urlchecker
any::devtools
any::roxygen2
ropengov/rogtemplate
needs: website
- name: Tidy code
run: |
@@ -48,17 +49,15 @@ jobs:

- name: Commit results
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m 'Tidy code' || echo "No changes to commit"
git push origin || echo "No changes to commit"
- name: Trigger pkgdown workflow
if: success()
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.REPO_GHA_PAT }}
repository: ${{ github.repository }}
event-type: trigger-pkgdown-workflow
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
14 changes: 6 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -31,15 +31,14 @@ URL: https://ropengov.github.io/eurostat/,
https://github.com/rOpenGov/eurostat
BugReports: https://github.com/rOpenGov/eurostat/issues
Depends:
methods,
R (>= 3.5.0)
Imports:
broom,
classInt,
countrycode,
curl,
dplyr,
httr (>= 1.4.0),
ISOweek,
jsonlite,
lubridate,
rappdirs,
@@ -49,18 +48,17 @@ Imports:
stringi,
stringr,
tibble,
tidyr (>= 1.0.0),
ISOweek
tidyr (>= 1.0.0)
Suggests:
RColorBrewer,
giscoR,
knitr,
rmarkdown,
sf,
sp,
testthat (>= 3.0.0),
remotes
testthat (>= 3.0.0)
VignetteBuilder:
knitr
Config/Needs/website: ggplot2, tmap, styler, sessioninfo,
ropengov/rogtemplate, ragg
Config/testthat/edition: 3
Config/testthat/parallel: false
Encoding: UTF-8
4 changes: 0 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -29,15 +29,13 @@ export(validate_nuts_regions)
importFrom(ISOweek,ISOweek2date)
importFrom(RefManageR,BibEntry)
importFrom(RefManageR,toBiblatex)
importFrom(broom,tidy)
importFrom(classInt,classIntervals)
importFrom(countrycode,countrycode)
importFrom(curl,curl_download)
importFrom(dplyr,case_when)
importFrom(dplyr,coalesce)
importFrom(dplyr,filter)
importFrom(dplyr,inner_join)
importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(httr,RETRY)
importFrom(httr,build_url)
@@ -52,7 +50,6 @@ importFrom(lubridate,dmy)
importFrom(lubridate,month)
importFrom(lubridate,year)
importFrom(lubridate,ymd)
importFrom(methods,as)
importFrom(readr,col_character)
importFrom(readr,cols)
importFrom(readr,read_tsv)
@@ -68,7 +65,6 @@ importFrom(tibble,as_tibble)
importFrom(tibble,is_tibble)
importFrom(tidyr,pivot_longer)
importFrom(tidyr,separate)
importFrom(utils,data)
importFrom(utils,download.file)
importFrom(utils,hasName)
importFrom(utils,toBibtex)
11 changes: 10 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -4,9 +4,18 @@

* Remove legacy code related to downloading data from old bulk download facilities and temporary functions added in package version 3.7.14.

* `get_eurostat_geospatial()` now leverages on `giscoR::gisco_get_nuts()` for
downloading geospatial data:
* `"spdf"` output class soft-deprecated, it would return a `sf` object with a message.
* `make_valid` parameter soft-deprecated.
* Added `...` to the function so additional parametes can be passed to `giscoR::gisco_get_nuts()`.
* Dataset `eurostat_geodata_60_2016` updated.

## Minor updates

* Print more informative API error messages.
* Removed `sp`, `methods` and `broom` packages from dependencies.
* Added `giscoR` to Suggests.

## Bug fixes

@@ -235,4 +244,4 @@

# eurostat 0.9.1 (2014-04-24)

* Package collected from statfi and smarterpoland
* Package collected from statfi and smarterpoland
1 change: 1 addition & 0 deletions R/data_countries.R
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
#' * **name**: Country name in English.
#' * **label**: Country name in the Eurostat database.
#'
#' @family datasets
#' @source <https://ec.europa.eu/eurostat/statistics-explained/index.php/Tutorial:Country_codes_and_protocol_order>,
#' <https://ec.europa.eu/eurostat/statistics-explained/index.php/Glossary:Euro_area>
"eu_countries"
220 changes: 106 additions & 114 deletions R/data_spatial.R
Original file line number Diff line number Diff line change
@@ -1,134 +1,126 @@
#' @title Geospatial data of Europe from GISCO in 1:60 million scale from
#' Geospatial data of Europe from GISCO in 1:60 million scale from
#' year 2016
#'
#' @description Geospatial data of Europe from GISCO in 1:60 million scale
#' from year 2016
#' @details
#'
#' @family datasets
#' @family geospatial
#' @format sf object
#' @docType data
#' @name eurostat_geodata_60_2016
#'
#' @details
#' The dataset contains 2016 observations (rows) and 12 variables (columns).
#'
#'
#' The object contains the following columns:
#' * **id**: JSON id code, the same as NUTS_ID. See NUTS_ID below for further clarification.
#' * **LEVL_CODE**: NUTS level code: 0 (national level), 1 (major socio-economic regions), 2 (basic regions for the application of regional policies) or 3 (small regions).
#' * **NUTS_ID**: NUTS ID code, consisting of country code and numbers (1 for NUTS 1, 2 for NUTS 2 and 3 for NUTS 3)
#' * **CNTR_CODE**: Country code: two-letter ISO code (ISO 3166 alpha-2), except in the case of Greece (EL).
#' * **id**: JSON id code, the same as **NUTS_ID**. See **NUTS_ID** below for
#' further clarification.
#' * **LEVL_CODE**: NUTS level code: 0 (national level), 1 (major
#' socio-economic regions), 2 (basic regions for the application of regional
#' policies) or 3 (small regions).
#' * **NUTS_ID**: NUTS ID code, consisting of country code and numbers (1 for
#' NUTS 1, 2 for NUTS 2 and 3 for NUTS 3)
#' * **CNTR_CODE**: Country code: two-letter ISO code (ISO 3166 alpha-2), except
#' in the case of Greece (EL).
#' * **NAME_LATN**: NUTS name in local language, transliterated to Latin script
#' * **NUTS_NAME**: NUTS name in local language, in local script.
#' * **MOUNT_TYPE**: Mountain typology for NUTS 3 regions.
#' \itemize{
#' \item{1: "where more than 50 % of the surface is covered by topographic mountain areas"}
#' \item{2: "in which more than 50 % of the regional population lives in topographic mountain areas"}
#' \item{3: "where more than 50 % of the surface is covered by topographic mountain areas and where more than 50 % of the regional population lives in these mountain areas"}
#' \item{4: non-mountain region / other region}
#' \item{0: no classification provided (e.g. in the case of NUTS 1 and NUTS 2 and non-EU countries)}
#' }
#' * 1: "where more than 50 % of the surface is covered by topographic
#' mountain areas"
#' * 2: "in which more than 50 % of the regional population lives in
#' topographic mountain areas"
#' * 3: "where more than 50 % of the surface is covered by topographic
#' mountain areas and where more than 50 % of the regional population lives
#' in these mountain areas"
#' * 4: non-mountain region / other region
#' * 0: no classification provided (e.g. in the case of NUTS 1 and NUTS 2 and
#' non-EU countries)
#' * **URBN_TYPE**: Urban-rural typology for NUTS 3 regions.
#' \itemize{
#' \item{1: predominantly urban region}
#' \item{2: intermediate region}
#' \item{3: predominantly rural region}
#' \item{0: no classification provided (e.g. in the case of NUTS 1 and NUTS 2 regions)}
#' }
#' * **COAST_TYPE**: Coastal typology for NUTS 3 regions.
#' \itemize{
#' \item{1: coastal (on coast)}
#' \item{2: coastal (>= 50% of population living within 50km of the coastline)}
#' \item{3: non-coastal region}
#' \item{0: no classification provided (e.g. in the case of NUTS 1 and NUTS 2 regions)}
#' }
#' * 1: predominantly urban region
#' * 2: intermediate region
#' * 3: predominantly rural region
#' * 0: no classification provided (e.g. in the case of NUTS 1 and NUTS 2
#' regions)
#' * **COAST_TYPE**: Coastal typology for NUTS 3 regions.
#' * 1: coastal (on coast)
#' * 2: coastal (>= 50% of population living within 50km of the coastline)
#' * 3: non-coastal region
#' * 0: no classification provided (e.g. in the case of NUTS 1 and NUTS 2
#' regions)
#' * **FID**: Same as NUTS_ID.
#' * **geo**: Same as NUTS_ID, added for for easier joins with dplyr. However,
#' it is recommended to use other identical fields for this purpose.
#' * **geometry**: geospatial information.
#' * **geo**: Same as NUTS_ID, added for for easier joins with dplyr. However, it is recommended to use other identical fields for this purpose.
#'
#' Dataset updated: 2022-06-28. For a more recent version, please use [get_eurostat_geospatial()] function.
#' @family datasets
#' @family geospatial
#' @format sf object
#' @source
#' Data source: Eurostat
#'
#'
#' Dataset updated: 2023-06-29. For a more recent version, please use
#' [giscoR::gisco_get_nuts()] function.
#'
#' @source
#' Data source: Eurostat via [giscoR::gisco_get_nuts()].
#'
#' © EuroGeographics for the administrative boundaries
#'
#' Data downloaded from: \url{https://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/administrative-units-statistical-units}
#' @references
#' The following copyright notice is provided for end user convenience.
#'
#' Data downloaded from:
#' <https://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/administrative-units-statistical-units>
#'
#' @references
#' The following copyright notice is provided for end user convenience.
#' Please check up-to-date copyright information from the eurostat website:
#' [GISCO: Geographical information and maps - Administrative units/statistical units](https://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/administrative-units-statistical-units)
#'
#' "In addition to the [general copyright and licence policy](https://ec.europa.eu/eurostat/web/main/about/policies/copyright) applicable to the whole Eurostat website, the following specific provisions apply to the datasets you are downloading. The download and usage of these data is subject to the acceptance of the following clauses:
#'
#' 1. The Commission agrees to grant the non-exclusive and not transferable right to use and process the Eurostat/GISCO geographical data downloaded from this page (the "data").
#'
#'
#' "In addition to the [general copyright and licence policy](https://ec.europa.eu/eurostat/web/main/about/policies/copyright) applicable to the whole Eurostat website, the following
#' specific provisions apply to the datasets you are downloading. The download
#' and usage of these data is subject to the acceptance of the following
#' clauses:
#'
#' 1. The Commission agrees to grant the non-exclusive and not transferable
#' right to use and process the Eurostat/GISCO geographical data downloaded
#' from this page (the "data").
#'
#' 1. The permission to use the data is granted on condition that:
#' \enumerate{
#' \item{the data will not be used for commercial purposes;}
#' \item{the source will be acknowledged. A copyright notice, as specified below, will have to be visible on any printed or electronic publication using the data downloaded from this page.}
#' }
#' 1. the data will not be used for commercial purposes;
#' 2. the source will be acknowledged. A copyright notice, as specified
#' below, will have to be visible on any printed or electronic publication
#' using the data downloaded from this page.
#'
#' ## Copyright notice
#'
#' When data downloaded from this page is used in any printed or electronic publication, in addition to any other provisions applicable to the whole Eurostat website, data source will have to be acknowledged in the legend of the map and in the introductory page of the publication with the following copyright notice:
#'
#'
#' When data downloaded from this page is used in any printed or electronic
#' publication, in addition to any other provisions applicable to the whole
#' Eurostat website, data source will have to be acknowledged in the legend of
#' the map and in the introductory page of the publication with the following
#' copyright notice:
#'
#' EN: © EuroGeographics for the administrative boundaries
#'
#'
#' FR: © EuroGeographics pour les limites administratives
#'
#'
#' DE: © EuroGeographics bezüglich der Verwaltungsgrenzen
#'
#' For publications in languages other than English, French or German, the translation of the copyright notice in the language of the publication shall be used.
#'
#' If you intend to use the data commercially, please contact EuroGeographics for information regarding their licence agreements."
#'
#' @seealso
#'
#' For publications in languages other than English, French or German, the
#' translation of the copyright notice in the language of the publication shall
#' be used.
#'
#' If you intend to use the data commercially, please contact EuroGeographics
#' for information regarding their licence agreements."
#'
#' @seealso [giscoR::gisco_get_nuts()] and
#' [Eurostat. (2019). Methodological manual on territorial typologies -- 2018 edition. Manuals and guidelines.](https://ec.europa.eu/eurostat/web/products-manuals-and-guidelines/-/ks-gq-18-008)
"eurostat_geodata_60_2016"

## -- 2016
# library(sf)
# library(httr)
#
# resp <- GET("http://ec.europa.eu/eurostat/cache/GISCO/distribution/v2/nuts/geojson/NUTS_RG_03M_2016_4326_LEVL_0.geojson")
# n0 <- st_read(content(resp, as="text"), stringsAsFactors = FALSE, quiet = TRUE)
# resp <- GET("http://ec.europa.eu/eurostat/cache/GISCO/distribution/v2/nuts/geojson/NUTS_RG_03M_2016_4326_LEVL_1.geojson")
# n1 <- st_read(content(resp, as="text"), stringsAsFactors = FALSE, quiet = TRUE)
# resp <- GET("http://ec.europa.eu/eurostat/cache/GISCO/distribution/v2/nuts/geojson/NUTS_RG_03M_2016_4326_LEVL_2.geojson")
# n2 <- st_read(content(resp, as="text"), stringsAsFactors = FALSE, quiet = TRUE)
# resp <- GET("http://ec.europa.eu/eurostat/cache/GISCO/distribution/v2/nuts/geojson/NUTS_RG_03M_2016_4326_LEVL_3.geojson")
# n3 <- st_read(content(resp, as="text"), stringsAsFactors = FALSE, quiet = TRUE)
# eurostat_geodata_60_2016 <- rbind(n0,n1,n2,n3)
# eurostat_geodata_60_2016$geo <- eurostat_geodata_60_2016$NUTS_ID
# save(eurostat_geodata_60_2016, file = "./data/eurostat_geodata_60_2016.rda", compress = "xz")


## -- 2013
# resp <- GET("http://ec.europa.eu/eurostat/cache/GISCO/distribution/v1/geojson/NUTS_RG_60M_2013_4258_LEVL_0.geojson")
# n0 <- st_read(content(resp, as="text"), stringsAsFactors = FALSE, quiet = TRUE)
# resp <- GET("http://ec.europa.eu/eurostat/cache/GISCO/distribution/v1/geojson/NUTS_RG_60M_2013_4258_LEVL_1.geojson")
# n1 <- st_read(content(resp, as="text"), stringsAsFactors = FALSE, quiet = TRUE)
# resp <- GET("http://ec.europa.eu/eurostat/cache/GISCO/distribution/v1/geojson/NUTS_RG_60M_2013_4258_LEVL_2.geojson")
# n2 <- st_read(content(resp, as="text"), stringsAsFactors = FALSE, quiet = TRUE)
# resp <- GET("http://ec.europa.eu/eurostat/cache/GISCO/distribution/v1/geojson/NUTS_RG_60M_2013_4258_LEVL_3.geojson")
# n3 <- st_read(content(resp, as="text"), stringsAsFactors = FALSE, quiet = TRUE)
# eurostat_geodata_60_2013 <- rbind(n0,n1,n2,n3)
# save(eurostat_geodata_60_2013, file = "./data/eurostat_geodata_60_2013.rda")

## --2010
# resp <- GET("http://ec.europa.eu/eurostat/cache/GISCO/distribution/v1/geojson/NUTS_RG_60M_2010_4258_LEVL_0.geojson")
# n0 <- st_read(content(resp, as="text"), stringsAsFactors = FALSE, quiet = TRUE)
# resp <- GET("http://ec.europa.eu/eurostat/cache/GISCO/distribution/v1/geojson/NUTS_RG_60M_2010_4258_LEVL_1.geojson")
# n1 <- st_read(content(resp, as="text"), stringsAsFactors = FALSE, quiet = TRUE)
# resp <- GET("http://ec.europa.eu/eurostat/cache/GISCO/distribution/v1/geojson/NUTS_RG_60M_2010_4258_LEVL_2.geojson")
# n2 <- st_read(content(resp, as="text"), stringsAsFactors = FALSE, quiet = TRUE)
# resp <- GET("http://ec.europa.eu/eurostat/cache/GISCO/distribution/v1/geojson/NUTS_RG_60M_2010_4258_LEVL_3.geojson")
# n3 <- st_read(content(resp, as="text"), stringsAsFactors = FALSE, quiet = TRUE)
# eurostat_geodata_60_2010 <- rbind(n0,n1,n2,n3)
# save(eurostat_geodata_60_2010, file = "./data/eurostat_geodata_60_2010.rda")

## --2006
# resp <- GET("http://ec.europa.eu/eurostat/cache/GISCO/distribution/v1/geojson/NUTS_RG_60M_2006_4258_LEVL_0.geojson")
# n0 <- st_read(content(resp, as="text"), stringsAsFactors = FALSE, quiet = TRUE)
# resp <- GET("http://ec.europa.eu/eurostat/cache/GISCO/distribution/v1/geojson/NUTS_RG_60M_2006_4258_LEVL_1.geojson")
# n1 <- st_read(content(resp, as="text"), stringsAsFactors = FALSE, quiet = TRUE)
# resp <- GET("http://ec.europa.eu/eurostat/cache/GISCO/distribution/v1/geojson/NUTS_RG_60M_2006_4258_LEVL_2.geojson")
# n2 <- st_read(content(resp, as="text"), stringsAsFactors = FALSE, quiet = TRUE)
# resp <- GET("http://ec.europa.eu/eurostat/cache/GISCO/distribution/v1/geojson/NUTS_RG_60M_2006_4258_LEVL_3.geojson")
# n3 <- st_read(content(resp, as="text"), stringsAsFactors = FALSE, quiet = TRUE)
# eurostat_geodata_60_2006 <- rbind(n0,n1,n2,n3)
# save(eurostat_geodata_60_2006, file = "./data/eurostat_geodata_60_2006.rda")
#'
#'
#' @examples
#'
#' eurostat_geodata_60_2016 <- eurostat::eurostat_geodata_60_2016
#'
#' # Manipulate and plot
#' if (require(sf)) {
#' library(sf)
#' # Filter NUTS3 from some countries in the same way than a regular data frame
#' example_nuts <- subset(eurostat_geodata_60_2016, LEVL_CODE == 3 &
#' CNTR_CODE %in% c("DK", "DE", "PL"))
#'
#' plot(example_nuts["CNTR_CODE"])
#' }
#'
NULL
606 changes: 218 additions & 388 deletions R/get_eurostat_geospatial.R

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions data-raw/eurostat_geodata_60_2016.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## code to prepare `eurostat_geodata_60_2016` dataset goes here
library(giscoR)
library(tidyverse)

# Current names internal)
from_gisco <- gisco_get_nuts(
year = 2016, resolution = 60,
epsg = 4326, update_cache = TRUE,
verbose = TRUE
)

from_gisco$geo <- from_gisco$NUTS_ID
from_gisco$id <- from_gisco$NUTS_ID

# End

eurostat_geodata_60_2016 <- from_gisco
unique(sf::st_is_valid(from_gisco))

# Sort by level and alphabetically
eurostat_geodata_60_2016 <- eurostat_geodata_60_2016 %>%
arrange(LEVL_CODE, NUTS_ID)

# Arrange names in proper order
sfcol <- attr(eurostat_geodata_60_2016, "sf_column")
rest <- c(
"id", "LEVL_CODE", "NUTS_ID", "CNTR_CODE", "NAME_LATN",
"NUTS_NAME", "MOUNT_TYPE", "URBN_TYPE", "COAST_TYPE",
"FID", "geo"
)

reorder <- intersect(unique(c(rest, sfcol)), names(eurostat_geodata_60_2016))
eurostat_geodata_60_2016 <- eurostat_geodata_60_2016[, reorder]

usethis::use_data(eurostat_geodata_60_2016, overwrite = TRUE, compress = "xz")
Binary file modified data/eurostat_geodata_60_2016.rda
Binary file not shown.

This file was deleted.

12 changes: 0 additions & 12 deletions docs/articles/vignette_files/header-attrs-2.6.4/header-attrs.js

This file was deleted.

12 changes: 0 additions & 12 deletions docs/articles/vignette_files/header-attrs-2.7.12/header-attrs.js

This file was deleted.

12 changes: 0 additions & 12 deletions docs/articles/vignette_files/header-attrs-2.8.4/header-attrs.js

This file was deleted.

12 changes: 0 additions & 12 deletions docs/articles/vignette_files/header-attrs-2.8/header-attrs.js

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

525 changes: 0 additions & 525 deletions docs/articles/website/mapping.html

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions docs/articles/website/maps_files/header-attrs-2.8/header-attrs.js

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

367 changes: 0 additions & 367 deletions docs/pkgdown.css

This file was deleted.

129 changes: 0 additions & 129 deletions docs/sitemap.xml

This file was deleted.

6 changes: 6 additions & 0 deletions man/eu_countries.Rd
106 changes: 74 additions & 32 deletions man/eurostat_geodata_60_2016.Rd
171 changes: 83 additions & 88 deletions man/get_eurostat_geospatial.Rd
1 change: 1 addition & 0 deletions man/tgs00026.Rd
2 changes: 1 addition & 1 deletion pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
@@ -13,6 +13,6 @@ reference:
- title: Additional functions
contents: has_concept("helpers")
- title: Datasets
contents: has_keyword("datasets")
contents: has_concept("datasets")
- title: About the package
contents: eurostat
6 changes: 6 additions & 0 deletions revdep/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
checks
library
checks.noindex
library.noindex
data.sqlite
*.html
95 changes: 77 additions & 18 deletions revdep/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,85 @@
# Platform

|field |value |
|:--------|:-------------------------------------------------------------------------------------------|
|version |R version 4.2.2 (2022-10-31) |
|os |macOS Ventura 13.2.1 |
|system |aarch64, darwin20 |
|ui |RStudio |
|language |(EN) |
|collate |en_US.UTF-8 |
|ctype |en_US.UTF-8 |
|tz |Europe/Helsinki |
|date |2023-02-22 |
|rstudio |2022.12.0+353 Elsbeth Geranium (desktop) |
|pandoc |2.19.2 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/ (via rmarkdown) |
|field |value |
|:--------|:------------------------------------------|
|version |R version 4.3.1 (2023-06-16 ucrt) |
|os |Windows 11 x64 (build 22621) |
|system |x86_64, mingw32 |
|ui |RStudio |
|language |(EN) |
|collate |Spanish_Spain.utf8 |
|ctype |Spanish_Spain.utf8 |
|tz |Europe/Madrid |
|date |2023-07-01 |
|rstudio |2023.06.0+421 Mountain Hydrangea (desktop) |
|pandoc |2.19.2 @ C:\PROGRA~1\Pandoc\pandoc.exe |

# Dependencies

|package |old |new |Δ |
|:---------|:------|:------|:--|
|eurostat |3.7.10 |3.7.14 |* |
|lubridate |NA |1.9.2 |* |
|readr |NA |2.1.4 |* |
|package |old |new |Δ |
|:-----------|:------|:----------|:--|
|eurostat |3.8.2 |4.0.0.9002 |* |
|askpass |1.1 |1.1 | |
|assertthat |0.2.1 |0.2.1 | |
|backports |1.4.1 |1.4.1 | |
|bibtex |0.5.1 |0.5.1 | |
|bit |4.0.5 |4.0.5 | |
|bit64 |4.0.5 |4.0.5 | |
|broom |1.0.5 |NA |* |
|cellranger |1.1.0 |1.1.0 | |
|classInt |0.4-9 |0.4-9 | |
|cli |3.6.1 |3.6.1 | |
|clipr |0.8.0 |0.8.0 | |
|countrycode |1.5.0 |1.5.0 | |
|cpp11 |0.4.4 |0.4.4 | |
|crayon |1.5.2 |1.5.2 | |
|curl |5.0.1 |5.0.1 | |
|dplyr |1.1.2 |1.1.2 | |
|e1071 |1.7-13 |1.7-13 | |
|ellipsis |0.3.2 |NA |* |
|fansi |1.0.4 |1.0.4 | |
|generics |0.1.3 |0.1.3 | |
|glue |1.6.2 |1.6.2 | |
|here |1.0.1 |1.0.1 | |
|hms |1.1.3 |1.1.3 | |
|httr |1.4.6 |1.4.6 | |
|ISOweek |0.6-2 |0.6-2 | |
|jsonlite |1.8.7 |1.8.7 | |
|lifecycle |1.0.3 |1.0.3 | |
|lubridate |1.9.2 |1.9.2 | |
|magrittr |2.0.3 |2.0.3 | |
|mime |0.12 |0.12 | |
|openssl |2.0.6 |2.0.6 | |
|pillar |1.9.0 |1.9.0 | |
|pkgconfig |2.0.3 |2.0.3 | |
|plyr |1.8.8 |1.8.8 | |
|prettyunits |1.1.1 |1.1.1 | |
|progress |1.2.2 |1.2.2 | |
|proxy |0.4-27 |0.4-27 | |
|purrr |1.0.1 |1.0.1 | |
|R6 |2.5.1 |2.5.1 | |
|rappdirs |0.3.3 |0.3.3 | |
|Rcpp |1.0.10 |1.0.10 | |
|readr |2.1.4 |2.1.4 | |
|readxl |1.4.2 |1.4.2 | |
|RefManageR |1.4.0 |1.4.0 | |
|regions |0.1.8 |0.1.8 | |
|rematch |1.0.1 |1.0.1 | |
|rlang |1.1.1 |1.1.1 | |
|rprojroot |2.0.3 |2.0.3 | |
|stringi |1.7.12 |1.7.12 | |
|stringr |1.5.0 |1.5.0 | |
|sys |3.4.2 |3.4.2 | |
|tibble |3.2.1 |3.2.1 | |
|tidyr |1.3.0 |1.3.0 | |
|tidyselect |1.2.0 |1.2.0 | |
|timechange |0.2.0 |0.2.0 | |
|tzdb |0.4.0 |0.4.0 | |
|utf8 |1.2.3 |1.2.3 | |
|vctrs |0.6.3 |0.6.3 | |
|vroom |1.6.3 |1.6.3 | |
|withr |2.5.0 |2.5.0 | |
|xml2 |1.3.4 |1.3.4 | |

# Revdeps

5 changes: 0 additions & 5 deletions revdep/check.R

This file was deleted.

Binary file not shown.
142 changes: 0 additions & 142 deletions revdep/checks.noindex/ARPALData/new/libraries.txt

This file was deleted.

140 changes: 0 additions & 140 deletions revdep/checks.noindex/ARPALData/old/libraries.txt

This file was deleted.

Binary file not shown.
178 changes: 0 additions & 178 deletions revdep/checks.noindex/convergEU/new/libraries.txt

This file was deleted.

176 changes: 0 additions & 176 deletions revdep/checks.noindex/convergEU/old/libraries.txt

This file was deleted.

Binary file removed revdep/checks.noindex/dataset/dataset_0.2.0.tar.gz
Binary file not shown.
148 changes: 0 additions & 148 deletions revdep/checks.noindex/dataset/new/libraries.txt

This file was deleted.

146 changes: 0 additions & 146 deletions revdep/checks.noindex/dataset/old/libraries.txt

This file was deleted.

Binary file removed revdep/checks.noindex/flagr/flagr_0.3.2.tar.gz
Binary file not shown.
97 changes: 0 additions & 97 deletions revdep/checks.noindex/flagr/new/libraries.txt

This file was deleted.

95 changes: 0 additions & 95 deletions revdep/checks.noindex/flagr/old/libraries.txt

This file was deleted.

Binary file removed revdep/checks.noindex/giscoR/giscoR_0.3.3.tar.gz
Binary file not shown.
Loading