do_aggregate | R Documentation |
Aggregate data according to the specification in tbl_Filgruppe
in AGGREGERE
column. The input in argument source
must be a lower
granularity level than the level
input.
do_aggregate(
dt = NULL,
source = c("grunnkrets", "fylke", "kommune", "bydel"),
level = getOption("orgdata.geo.levels"),
year = NULL,
aggregate.col = NULL,
geoDT = NULL,
check = NULL,
base = NULL,
control = FALSE,
wide = NULL
)
dt |
Input data preferrably in a |
source |
What geographical granularity codes that is available in the
source data. This will be used for merging with the geo codebook generated
from |
level |
Geographical granularity for aggregating data. See |
year |
Which year the geograhical codes to be recoded to. If it is empty
then global option for |
aggregate.col |
Other columns to aggregate other than the standard ie.
|
geoDT |
Geo codes to aggregate dataset with |
check |
If TRUE then output will keep variables for geographical levels
without aggregating it. This is useful to check for geographical codes that
are missing. Else use |
base |
Logical value. If |
control |
Logical value. |
wide |
Column(s) from reshape wide |
Other aggregate functions:
get_aggregate()
## Not run:
# To aggregate source data with enumeration area codes ie. grunnkrets, to
# manucipaltiy ie. kommune
dt <- make_file("BEFOLKNING")
DT <- do_aggregate(dt, source = "grunnkrets", level = "kommune")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.