R: Reads microdata for deaths as provided by the INE
defun2011
R Documentation
Reads microdata for deaths as provided by the INE
Description
This function reads the microdata file for deaths statistics, as collected by the INE in Spain.
It was originally built using the metadata for the 2011 file and may work with microdata files for other yearly submissions.
Usage
defun2011( file )
Arguments
file
The name of the microdata file
Details
This function reads microdadata files for the deaths statistics collected by the the Spanish Statistical Office, INE.
The survey data can be downloaded from http://www.ine.es/en/prodyser/micro_mnp_defun_en.htm.
It has been built and tested on the 2011 files and may be able to read files conforming to previous (or later) formats.
Value
A data.set, a data structure defined in the memisc package.
# This command reads a few lines sampled from the EPA for the 1Q 2011
sample.defun.data <- defun2011(system.file( "extdata",
"sampleDEFUN2010.txt",
package = "MicroDatosEs") )
summary( as.data.frame( sample.defun.data ) )
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(MicroDatosEs)
Loading required package: memisc
Loading required package: lattice
Loading required package: MASS
Attaching package: 'memisc'
The following objects are masked from 'package:stats':
contr.sum, contr.treatment, contrasts
The following object is masked from 'package:base':
as.array
Loading required package: Hmisc
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2
Attaching package: 'Hmisc'
The following objects are masked from 'package:memisc':
%nin%, html
The following objects are masked from 'package:base':
format.pval, round.POSIXt, trunc.POSIXt, units
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MicroDatosEs/defun2011.Rd_%03d_medium.png", width=480, height=480)
> ### Name: defun2011
> ### Title: Reads microdata for deaths as provided by the INE
> ### Aliases: defun2011
> ### Keywords: manip
>
> ### ** Examples
>
> # This command reads a few lines sampled from the EPA for the 1Q 2011
> sample.defun.data <- defun2011(system.file( "extdata",
+ "sampleDEFUN2010.txt",
+ package = "MicroDatosEs") )
Error in spss.fixed.file(file = file, columns.file = file.column, varlab.file = file.var, :
undefined variables in 'codes.file'
Calls: defun2011 -> spss.fixed.file
In addition: Warning messages:
1: In read.table(file.start.end, header = T, sep = "\t", ...) :
invalid input found on input connection '/home/ddbj/local/lib64/R/library/MicroDatosEs/metadata/defun_2011_mdat1.txt'
2: In read.table(file.start.end, header = T, sep = "\t", ...) :
incomplete final line found by readTableHeader on '/home/ddbj/local/lib64/R/library/MicroDatosEs/metadata/defun_2011_mdat1.txt'
3: In scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
invalid input found on input connection '/home/ddbj/local/lib64/R/library/MicroDatosEs/metadata/defun_2011_mdat2.txt'
4: In scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
EOF within quoted string
5: In read.table(file, header = T, sep = "\t", ...) :
invalid input found on input connection '/home/ddbj/local/lib64/R/library/MicroDatosEs/metadata/defun_2011_mdat1.txt'
6: In read.table(file, header = T, sep = "\t", ...) :
incomplete final line found by readTableHeader on '/home/ddbj/local/lib64/R/library/MicroDatosEs/metadata/defun_2011_mdat1.txt'
7: In scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
invalid input found on input connection '/home/ddbj/local/lib64/R/library/MicroDatosEs/metadata/defun_2011_mdat2.txt'
8: In scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
EOF within quoted string
Execution halted