data-raw/build_all.R

# Instructions
#
# setwd('/path/to/lifetable/')
# source('data-raw/build_all.R')

require(devtools)

# functions for loading ABS lifetable data
source('./data-raw/load_lifetable.R')

# bind all the ABS data together
abs_lt <- do.call(rbind,
                  lapply(2002:2013,
                         function(y) {
                             message(paste('Extracting', y))
                             data.frame(load_abs_lifetable(y,
                                                           './data-raw/abs'),
                                        year=y)
                         }))

use_data(abs_lt, pkg='.', internal=FALSE, overwrite=TRUE)
stephematician/lifetable documentation built on May 30, 2019, 3:17 p.m.