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

dplyr functions do not work for geofacet_grid objects #437

Open
mtennekes opened this issue Dec 6, 2024 · 0 comments
Open

dplyr functions do not work for geofacet_grid objects #437

mtennekes opened this issue Dec 6, 2024 · 0 comments

Comments

@mtennekes
Copy link

They only work after removing the `"geofacet_grid" class:

library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(geofacet)

nl_prov_grid1 = geofacet::nl_prov_grid1

nl_prov_grid1 |> 
    mutate(name = ifelse(name == "Friesland", "Fryslan", name))
#> Error in `vec_data()`:
#> ! `x` must be a vector, not a <data.frame/geofacet_grid> object.

class(nl_prov_grid1) = "data.frame"

nl_prov_grid1 |> 
    mutate(name = ifelse(name == "Friesland", "Fryslan", name))
#>    row col code          name
#> 1    1   2   FR       Fryslan
#> 2    1   3   GR     Groningen
#> 3    2   1   NH Noord-Holland
#> 4    2   3   DR       Drenthe
#> 5    2   2   FL     Flevoland
#> 6    3   1   ZH  Zuid-Holland
#> 7    3   3   OV    Overijssel
#> 8    3   2   UT       Utrecht
#> 9    4   3   GE    Gelderland
#> 10   4   2   NB Noord-Brabant
#> 11   4   1   ZE       Zeeland
#> 12   5   3   LI       Limburg

Created on 2024-12-06 with reprex v2.1.1

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

No branches or pull requests

1 participant