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

combination of add_nuts_level() and label_eurostat() does not work properly #186

Closed
michielvandijk opened this issue Sep 10, 2020 · 3 comments

Comments

@michielvandijk
Copy link

I am combining the functions add_nuts_level() and label_eurostat() but somehow the functions interfere.

For example, this works fine, resulting in a correct nuts_level column:
df <- get_eurostat("agr_r_accts") %>%
add_nuts_level(geo_labels = "geo")

But when I run this:
df2 <- df %>%
label_eurostat(code = "geo", fix_duplicated = TRUE)

I get the message:
Warning message:
In label_eurostat(y[[i]], i, eu_order = eu_order, lang = lang, countrycode = countrycode, :
All labels for nuts_level were not found.

and the nuts_level column gets mixed up.

I also tried a different order, not keeping the code columns, different datasets, etc but somehow the label_eurostat() function wants to identidy the nuts level as well, which fails, perhaps because there are duplicated labels?

@antaldaniel
Copy link
Contributor

I think that we should connect this to the regions package, and make a vignette about working with subnational statistics. The duplication comes from the problem that the regions package solves: often in the same dataset the same geo is present with two different definitions. This is a bug on Eurostat's side, not on the eurostat packages.

@antaldaniel
Copy link
Contributor

These functions will be deprecated as a new package grew out of them, which is already on CRAN under the name regions. On the devel branch there is a new tutorial, and the functions give a message or warning, and when appropriate, call the regions function instead.

@antagomir , @michielvandijk , I think that this issue can be closed as soon as the devel branch is merged to the master.

@antagomir
Copy link
Member

Done in #217

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants