View source: R/as.data.frame.px.R
as.data.frame.px | R Documentation |
This function extracts the data component from a px object as a data.frame
.
## S3 method for class 'px' as.data.frame( x, ..., use.codes = FALSE, warnings.as.errors = TRUE, direction = 'long')
x |
a px object |
use.codes |
If true, this parameter replaces the names (or levels) of the variables by their codes, if available; alternatively, it can be a character vector identifying those variables for which codes will replace the levels of the variables. See details section. |
warnings.as.errors |
If true, the function will fail in case any issues are found; otherwise, it will generate warnings. |
direction |
character string, either ‘"wide"’ to reshape to wide format, or ‘"long"’ to reshape to long format (default). |
... |
Additional arguments, currently not used |
The PC-Axis provides two alternative mechanisms for naming variables: their values or their codes, usually less verbose.
The the use.codes
parameter can be used to select those variables for which the CODES attribute in the PC-Axis file for naming the levels of the variables.
It should be noted that there may not be CODES for all variables; in such cases, the VALUES are used instead.
The function will operate in 'paranoid mode' unless warnings.as.errors
is set to FALSE
.
In such mode, the function will fail if any issues are found in the data.
If warnings.as.errors
is set to FALSE
, the function will do its best to solve some known issues in some PC-Axis files.
A data.frame object.
Carlos J. Gil Bellosta, Oscar Perpiñán Lamigueiro, Francisco J. Viciana Fernández, Emilio Torres
https://www.scb.se/globalassets/vara-tjanster/px-programmen/px-file_format_specification_2013.pdf
read.px
,
as.array.px
my.px.object <- read.px(system.file("extdata", "example.px", package = "pxR")) my.px.data <- as.data.frame(my.px.object)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.