read.px: Reads a PC-Axis file

View source: R/read.px.R

read.pxR Documentation

Reads a PC-Axis file

Description

This function reads a PC-AXIS file (a text file with certain format) and creates an object of the class px.

Usage

read.px(filename, encoding = NULL,
        na.strings = c('"."', '".."', '"..."', '"...."', '"....."', '"......"',
                       '":"'))

Arguments

filename

The name of the PC-Axis file to read

encoding

A character string describing the current encoding; see the Details section

na.strings

A character to be interpreted as missing value in the DATA field of the PC-AXIS file. The chapter 4 of the second reference provides details about the dot codes used in the PC-AXIS format.

Details

This function reads data files in the PC-Axis format. The format is described in the two documents in the reference section.

According to them, null values can be encoded using ".", "..", "...", or "....".

Also, the documentation is not very specific concerning the actual encoding to be expected in PC-Axis files. It is however quite safe to assume that they will be encoded using some "latin1" variant. The alternative value for the encoding argument would be "utf-8".

Value

An object of the class px, which is essentially a list comprising the fields of a PC-AXIS file (see references for details).

Author(s)

Carlos J. Gil Bellosta, Oscar Perpiñan Lamigueiro, Francisco J. Viciana Fernández

References

https://www.scb.se/globalassets/vara-tjanster/px-programmen/px-file_format_specification_2013.pdf https://tilastokeskus.fi/tup/pcaxis/tiedostomuoto2006_laaja_en.pdf

See Also

as.data.frame.px, as.array.px iconv

Examples


my.px.object <- read.px(system.file("extdata", "example.px",
                        package = "pxR") )
my.px.data   <-  as.data.frame( my.px.object )


pxR documentation built on Nov. 23, 2022, 9:06 a.m.

Related to read.px in pxR...