Select Layers to Data

SelectLayersData(object, targets = NULL, layers = NULL, cast = TRUE,
  narrow = FALSE, expand.time.invariant = FALSE)

Arguments

object

instance of Layers class

targets

specifies the targets of layers to be selected, defaulting to c('regions')

layers

specifies the layers to be selected. If given as a named character vector, then layers get renamed with new names as values, and old names as names per plyr::rename

narrow

narrow the resulting data frame to just the fields containing data (as described by flds in the default wide result) #@param expand.time.invariant for layers without a year column, populate the same value throughout all years where available in other layer(s) #@param cast whether to cast the resulting dataset, or leave it melted, defaults to TRUE

Value

data.frame with the merged data of selected layers having the following fields:

  • layer - layer name, possibly renamed

  • layer0 - original layer name, if fed a named character vector to layers

  • id_num - numeric id

  • id_chr - character id

  • id_name - fieldname of id in original layer csv file

  • category - category

  • category_name - fieldname of character in original layer csv file

  • year - year

  • val_num - numeric value

  • val_chr - character value

  • val_name - fieldname of value in original layer csv file

  • flds - data fields used for the layer

Details

If neither targets or layers are specified then all layers are returned. If targets and layers are specified, then the union of the two sets of layers are returned, with any renamed layers renamed.