z22_pivot_longer | R Documentation |
Helper function to convert the output of z22_data
to a
long table. This can be useful for plotting or other data wrangling tasks.
Note that pivoting can quickly become expensive for larger 100m grids.
z22_pivot_longer(.data, feature, lang = c("english", "german"))
.data |
Output of |
feature |
A grid feature that is represented by |
lang |
Specifies the language of the output description. Can be
either |
Note that all columns starting with "cat_*"
are automatically used
for pivoting.
A dataframe containing the columns category
, value
,
x
and y
. All non-category columns are preserved.
# get feature grid
age <- z22_data("age_short", res = "10km")
# pivot to a long table
z22_pivot_longer(age, feature = "age_short")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.