Learn R Programming

pxR (version 0.42.7)

as.array.px: Extraction of data from px objects into arrays

Description

This function extracts the data component from a px object as a array.

Usage

# S3 method for px
as.array(x, use.codes = FALSE, ...)

Value

An array

Arguments

x

A px object.

use.codes

A logical value to indicate whether to use CODES instead of VALUES as names of the levels: TRUE to use CODES, defaut FALSE. Or a vector with the names of the variables that use CODES to identify levels

...

Additional arguments. Not used yet.

Author

Francisco J. Viciana

References

https://www.scb.se/globalassets/vara-tjanster/px-programmen/px-file_format_specification_2013.pdf

See Also

read.px, as.data.frame.px

Examples

Run this code
my.px     <- read.px(system.file("extdata", "example.px", package = "pxR"))
my.array  <- as.array(my.px)
my.array2  <- as.array(my.px ,use.codes=TRUE)
my.array3  <- as.array(my.px ,use.codes=c('municipios'))

Run the code above in your browser using DataLab