Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
eoR/demo/RE1.R
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
53 lines (41 sloc)
1.1 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Examples eoR package class RE1 | |
# Copyright (C) 2019 Rainer Walke | |
require(data.table) | |
require(eoR) | |
# read all information from 'GENESIS-Tabelle: 12411-03-03-4' | |
# example data similar to data from | |
# Statistische Ämter des Bundes und der Länder, Deutschland, 2019 | |
# Bevölkerung nach Geschlecht, Nationalität und Altersgruppen | |
infile4 <- file.path(system.file(package="eoR"), "extdata", "12411-03-03-4m.csv") | |
r1 <- readRegExp(infile4) | |
length((r1)) | |
r1 | |
header(r1) | |
footer(r1) | |
re1(r1) | |
re1total(r1) | |
## | |
# descriptive tables and a ranges | |
re1(r1)[, table(Year)] | |
re1(r1)[, table(Age_Name)] | |
re1(r1)[, range(AgeLow)] | |
content(r1) | |
region(r1) | |
protocol(r1) | |
# select some years | |
(r2 <- selectYears(r1, c(2016))) | |
# descriptive tables and a ranges | |
re1(r2)[, table(Year)] | |
re1(r2)[, table(Age_Name)] | |
re1(r2)[, range(AgeLow)] | |
re1(r2) | |
re1total(r2) | |
# select a reagion | |
(r3 <- selectRegion(r2, "03")) | |
# descriptive tables and a ranges | |
re1(r3)[, table(Year)] | |
re1(r3)[, table(Age_Name)] | |
re1(r3)[, range(AgeLow)] | |
re1(r3) | |
re1total(r3) | |
merge(re1(r3), re1total(r3)[,c("Region_Code","Total1","Male","Female")], by = "Region_Code") |