set_variables {rolap} | R Documentation |
The variables layer includes the names and description through various fields of the variables contained in the reports.
set_variables(gl, variables, keep_all_variables_na)
## S3 method for class 'geolayer'
set_variables(gl, variables, keep_all_variables_na = FALSE)
gl |
A |
variables |
A |
keep_all_variables_na |
A boolean, keep rows with all variables NA. |
When we set the variables layer, after filtering it, the data layer is also filtered keeping only the variables from the variables layer.
By default, rows that are NA for all variables are eliminated.
A sf
object.
Other query functions:
as_GeoPackage()
,
as_geolayer()
,
filter_dimension()
,
get_layer()
,
get_variable_description()
,
get_variables()
,
run_query()
,
select_dimension()
,
select_fact()
,
set_layer()
,
star_query()
gl <- mrs_db_geo |>
as_geolayer()
v <- gl |>
get_variables()
v <- v |>
dplyr::filter(year == '1966' | year == '2016')
gl_sel <- gl |>
set_variables(v)