set_layer {rolap}R Documentation

Set geographic layer

Description

If for some reason we modify the geographic layer, for example, to add a new calculated variable, we can set that layer to become the new geographic layer of the geolayer object using this function.

Usage

set_layer(gl, layer)

## S3 method for class 'geolayer'
set_layer(gl, layer)

Arguments

gl

A geolayer object.

layer

A sf object.

Value

A geolayer object.

See Also

Other query functions: as_GeoPackage(), as_geolayer(), filter_dimension(), get_layer(), get_variable_description(), get_variables(), run_query(), select_dimension(), select_fact(), set_variables(), star_query()

Examples


gl <- mrs_db_geo |>
  as_geolayer()

l <- gl |>
  get_layer()

l$tpc_001 <- l$var_002 * 100 / l$var_001

gl <- gl |>
  set_layer(l)


[Package rolap version 2.5.1 Index]