diff --git a/DESCRIPTION b/DESCRIPTION index 3287863..2757f62 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,7 +4,7 @@ Title: Utilities for Official Spanish Microdata Version: 0.8.11 Date: 2017-04-27 Encoding: UTF-8 -Authors@R:c( person("Carlos J.", "Gil Bellosta", email="cgb@datanalytics.com", role=c('aut', 'cre')), +Authors@R: c( person("Carlos J.", "Gil Bellosta", email="cgb@datanalytics.com", role=c('aut', 'cre')), person("Carlos", "Neira", email = "cneirac@gmail.com", role="ctb"), person("Diego", "Paniagua Sánchez", email = "dpansan@gmail.com", role="ctb"), person("Fiorella", "Mori Peláez", email = "fiorella.mori.pelaez@gmail.com", role="ctb"), @@ -15,3 +15,4 @@ Depends: readr License: GPL-3 LazyLoad: yes LazyData: yes +RoxygenNote: 6.0.1 diff --git a/R/censo2010.R b/R/censo2010.R index 3b69800..c3d3e1c 100644 --- a/R/censo2010.R +++ b/R/censo2010.R @@ -1,3 +1,27 @@ +#' Download data from 2010 Spanish Census from INE +#' +#' This function downloads the data from 2010 (or later) Spanish Census using the information provided by the Spanish Statistical Office (INE). +#' +#' @param file Character string with the name of the microdata file provided by the INE on the +#' \href{http://www.ine.es/censos2011_datos/cen11_datos_microdatos.htm}{Census} section. It allows either a path to a file, +#' or literal data (single string or raw vector). It also allows compressed files in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} format. +#' +#' @return \code{\link[tibble]{tibble}} with all avaliable requested data where each row corresponds to an anonymised citizen. +#' @details This function reads microdata from the 2010 census in Spain. It was originally built using the metadata for 2010 file but it may be used for later years. +#' +#' Note that the loaded object will be of considerable size and may require a computer from 8 GB of RAM. In order to avoid this kind of computational issues, you can also download the splitted version provided by the INE. +#' @author Carlos Neira and Carlos J. Gil Bellosta +#' @note The \code{file} parameter allows any flat file with fixed width. +#' @references http://www.ine.es/prodyser/microdatos.htm +#' @examples +#' # Downloaded \href{ftp://www.ine.es/temas/censopv/cen11/Microdatos_personas_nacional.zip}{data} +#' \dontrun{ +#' raw <- censo2010("MicrodatosCP_NV_per_nacional_3VAR.txt") +#' summary(raw) +#' } +#' @seealso \code{\link[read_fwf]{readr}} to read fixed width files. + + ################################################################### # cjgb # 20140428 diff --git a/R/defun2011.R b/R/defun2011.R index 2651386..c716ebf 100644 --- a/R/defun2011.R +++ b/R/defun2011.R @@ -1,3 +1,26 @@ +#' Download data for deaths from INE +#' +#' This function downloads deaths statistcs from the Spanish Statistical Office (INE). +#' +#' @param file Character string with the name of the microdata file provided by the INE on the +#' \href{http://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C&cid=1254736177008&menu=resultados&secc=1254736195450&idp=1254735573002}{Deaths} section. It allows either a path to a file +#' or literal data (single string or raw vector). It also allows compressed files in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} format. +#' +#' @return \code{\link[tibble]{tibble}} with all avaliable requested data where each row corresponds to an anonymised citizen. +#' @details This function reads deaths microdata in Spain. +#' +#' It was originally built using the metadata for the 2011 file and may work with microdata files for other yearly submissions. Previous files have a different, non compatible, format. +#' @author Carlos J. Gil Bellosta +#' @note The \code{file} parameter allows any flat file with fixed width. +#' @references http://www.ine.es/prodyser/microdatos.htm +#' @examples +#' \dontrun{ +#' raw <- defun2011("datos_2016.zip") # It will be automatically uncompressed. +#' summary(raw) +#' } +#' @seealso \code{\link[read_fwf]{readr}} to read fixed width files. + + ################################################################### # cjgb # 20120811 diff --git a/R/ees2010.R b/R/ees2010.R index e2374b7..2bd6d18 100644 --- a/R/ees2010.R +++ b/R/ees2010.R @@ -1,3 +1,25 @@ +#' Download data from the Encuesta de Estructura Salarial (EES) +#' +#' This function downloads data from the Spanish Survey of Salary Structure using the information provided by the Spanish Statistical Office (INE). +#' +#' @param file Character string with the name of the microdata file provided by the INE on the +#' \href{http://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C&cid=1254736177025&menu=resultados&secc=1254736195110&idp=1254735976596}{EES} section. It allows either a path to a file, +#' or literal data (single string or raw vector). It also allows compressed files in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} format. +#' +#' @return \code{\link[tibble]{tibble}} with all avaliable requested data where each row corresponds to an anonymised citizen. +#' @details This function reads microdata from the Survey of Salary Structure in Spain. It was originally built using the metadata for 2010 file but it may be used for later years. Previous files have a different, non compatible, format. +#' +#' @author Carlos J. Gil Bellosta, with major contributions from José Luis Cañadas Reche +#' @note The \code{file} parameter allows any flat file with fixed width. +#' @references http://www.ine.es/prodyser/microdatos.htm +#' @examples +#' \dontrun{ +#' raw <- ees2010("datos_2014.zip") # It will be automatically uncompressed. +#' summary(raw) +#' } +#' @seealso \code{\link[read_fwf]{readr}} to read fixed width files. + + ################################################################### # cjgb # 20120305 diff --git a/R/epa2005.R b/R/epa2005.R index 66cee93..a936cb2 100644 --- a/R/epa2005.R +++ b/R/epa2005.R @@ -1,3 +1,25 @@ +#' Download data from the Encuesta de Población Activa (EPA) +#' +#' This function downloads the data from the Spanish Active Population Survey using the information provided by the Spanish Statistical Office (INE). +#' +#' @param file Character string with the name of the microdata file provided by the INE on the +#' \href{http://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C&cid=1254736176918&menu=resultados&secc=1254736030639&idp=1254735976595}{EPA} section. It allows either a path to a file, +#' or literal data (single string or raw vector). It also allows compressed files in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} format. +#' +#' @return \code{\link[tibble]{tibble}} with all avaliable requested data where each row corresponds to an anonymised citizen. +#' @details This function reads microdata from the quarterly Active Population Survey in Spain. It was originally built using the metadata for 2005 file but it may be used for later years. Previous files have a different, non compatible, format. +#' +#' @author Carlos J. Gil Bellosta +#' @note The \code{file} parameter allows any flat file with fixed width. +#' @references http://www.ine.es/prodyser/microdatos.htm +#' @examples +#' \dontrun{ +#' raw <- epa2005("EPA4T017") +#' summary(raw) +#' } +#' @seealso \code{\link[read_fwf]{readr}} to read fixed width files. + + ################################################################### # cjgb # 20120305 diff --git a/R/epf.2011.gastos.R b/R/epf.2011.gastos.R index ad6ada6..75e201b 100644 --- a/R/epf.2011.gastos.R +++ b/R/epf.2011.gastos.R @@ -1,3 +1,25 @@ +#' Download data from the Encuesta de Presupuestos Familiares (EPF) +#' +#' This function downloads data from the Spanish Survey of Family Budgets \strong{(Expenditure approach)} using the information provided by the Spanish Statistical Office (INE). +#' +#' @param file Character string with the name of the microdata file provided by the INE on the +#' \href{http://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C&cid=1254736176806&menu=resultados&secc=1254736195147&idp=1254735976608}{EPF} section. It allows either a path to a file, +#' or literal data (single string or raw vector). It also allows compressed files in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} format. +#' +#' @return \code{\link[tibble]{tibble}} with all avaliable requested data where each row corresponds to an anonymised citizen. +#' @details This function reads microdata from the expenditure approach of the Survey of Family Budgets in Spain. It was originally built using the metadata for 2011 file but it may be used for later years. Previous files have a different, non compatible, format. +#' +#' @author Diego Paniagua Sánchez and Carlos J. Gil Bellosta +#' @note The \code{file} parameter allows any flat file with fixed width. +#' @references http://www.ine.es/prodyser/microdatos.htm +#' @examples +#' \dontrun{ +#' raw <- epf.2011.gastos("sample_gastos_a2011.txt") +#' summary(raw) +#' } +#' @seealso \code{\link[read_fwf]{readr}} to read fixed width files. + + ################################################################### # Diego Paniagua Sánchez # 20150906 diff --git a/R/epf.2011.hogares.R b/R/epf.2011.hogares.R index fa3f228..28fc26e 100644 --- a/R/epf.2011.hogares.R +++ b/R/epf.2011.hogares.R @@ -1,3 +1,25 @@ +#' Download data from the Encuesta de Presupuestos Familiares (EPF) +#' +#' This function downloads data from the Spanish Survey of Family Budgets \strong{(Homes approach)} using the information provided by the Spanish Statistical Office (INE). +#' +#' @param file Character string with the name of the microdata file provided by the INE on the +#' \href{http://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C&cid=1254736176806&menu=resultados&secc=1254736195147&idp=1254735976608}{EPF} section. It allows either a path to a file, +#' or literal data (single string or raw vector). It also allows compressed files in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} format. +#' +#' @return \code{\link[tibble]{tibble}} with all avaliable requested data where each row corresponds to an anonymised citizen. +#' @details This function reads microdata from the homes approach of the Survey of Family Budgets in Spain. It was originally built using the metadata for 2011 file but it may be used for later years. Previous files have a different, non compatible, format. +#' +#' @author Diego Paniagua Sánchez and Carlos J. Gil Bellosta +#' @note The \code{file} parameter allows any flat file with fixed width. +#' @references http://www.ine.es/prodyser/microdatos.htm +#' @examples +#' \dontrun{ +#' raw <- epf.2011.gastos("sample_hogares_a2011.txt") +#' summary(raw) +#' } +#' @seealso \code{\link[read_fwf]{readr}} to read fixed width files. + + ################################################################### # Diego Paniagua Sánchez # 20150906 diff --git a/R/epf.2011.miembros.R b/R/epf.2011.miembros.R index b8705b2..4a646f6 100644 --- a/R/epf.2011.miembros.R +++ b/R/epf.2011.miembros.R @@ -1,3 +1,26 @@ +#' Download data from the Encuesta de Presupuestos Familiares (EPF) +#' +#' This function downloads data from the Spanish Survey of Family Budgets \strong{(Members approach)} using the information provided by the Spanish Statistical Office (INE). +#' +#' @param file Character string with the name of the microdata file provided by the INE on the +#' \href{http://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C&cid=1254736176806&menu=resultados&secc=1254736195147&idp=1254735976608}{EPF} section. It allows either a path to a file, +#' or literal data (single string or raw vector). It also allows compressed files in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} format. +#' +#' @return \code{\link[tibble]{tibble}} with all avaliable requested data where each row corresponds to an anonymised citizen. +#' @details This function reads microdata from the members approach of the Survey of Family Budgets in Spain. It was originally built using the metadata for 2011 file but it may be used for later years. Previous files have a different, non compatible, format. +#' +#' @author Diego Paniagua Sánchez and Carlos J. Gil Bellosta +#' @note The \code{file} parameter allows any flat file with fixed width. +#' @references http://www.ine.es/prodyser/microdatos.htm +#' @examples +#' \dontrun{ +#' raw <- epf.2011.gastos("sample_miembros_a2011.txt") +#' summary(raw) +#' } +#' @seealso \code{\link[read_fwf]{readr}} to read fixed width files. + + + ################################################################### # Diego Paniagua Sánchez # 20150906 diff --git a/R/padron2016.R b/R/padron2016.R index 5c71969..66b7079 100644 --- a/R/padron2016.R +++ b/R/padron2016.R @@ -1,3 +1,25 @@ +#' Download data from the "Padrón" +#' +#' This function downloads data from the Spanish "padrón" using the information provided by the Spanish Statistical Office (INE). +#' +#' @param file Character string with the name of the microdata file provided by the INE on the +#' \href{http://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C&cid=1254736177012&menu=resultados&secc=1254736195462&idp=1254734710990}{Padrón} section. It allows either a path to a file, +#' or literal data (single string or raw vector). It also allows compressed files in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} format. +#' +#' @return \code{\link[tibble]{tibble}} with all avaliable requested data where each row corresponds to an anonymised citizen. +#' @details This function reads microdata from the members approach of the "Padrón" in Spain. It was originally built using the metadata for 2016 file but it may be used for later years. Previous files have a different, non compatible, format. +#' +#' @author Carlos J. Gil Bellosta; metadata provided by Fiorella Mori. +#' @note The \code{file} parameter allows any flat file with fixed width. +#' @references http://www.ine.es/prodyser/microdatos.htm +#' @examples +#' \dontrun{ +#' raw <- epf.2011.gastos("sample_padron_2016.txt") +#' summary(raw) +#' } +#' @seealso \code{\link[read_fwf]{readr}} to read fixed width files. + + ################################################################### # cjgb # 20170427 diff --git a/man/censo2010.Rd b/man/censo2010.Rd index 5c277d6..dd621b2 100644 --- a/man/censo2010.Rd +++ b/man/censo2010.Rd @@ -1,37 +1,44 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/censo2010.R \name{censo2010} \alias{censo2010} -\title{ -Reads microdata for the 2010 decennial census provided by the INE -} -\description{ -This function reads the microdata file for the Spanish 2010 Census. -} +\title{Download data from 2010 Spanish Census from INE} \usage{ censo2010(file) } - \arguments{ - \item{file}{ The name of the microdata file } -} -\details{ -This function reads microdadata file for the 2010 decennial census in Spain. - -Mind that a powerful computer may be needed to read the full census file. Reading the full set of columns may require a computer with almost 20GB of RAM. The INE provides a version of the data splitted into three different files that can be used instead. +\item{file}{Character string with the name of the microdata file provided by the INE on the +\href{http://www.ine.es/censos2011_datos/cen11_datos_microdatos.htm}{Census} section. It allows either a path to a file, +or literal data (single string or raw vector). It also allows compressed files in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} format.} } \value{ -A \code{as.data.frame}. +\code{\link[tibble]{tibble}} with all avaliable requested data where each row corresponds to an anonymised citizen. } - -\author{ -CarlosNeira with minor modifications by Carlos J. Gil Bellosta after data file format changes. +\description{ +This function downloads the data from 2010 (or later) Spanish Census using the information provided by the Spanish Statistical Office (INE). } +\details{ +This function reads microdata from the 2010 census in Spain. It was originally built using the metadata for 2010 file but it may be used for later years. +Note that the loaded object will be of considerable size and may require a computer from 8 GB of RAM. In order to avoid this kind of computational issues, you can also download the splitted version provided by the INE. +} +\note{ +The \code{file} parameter allows any flat file with fixed width. +} \examples{ -## The first 1000 lines from the census file are provided within the package -c.file <- system.file("extdata", "sampleCenso2010.txt", - package = "MicroDatosEs") -res <- censo2010(c.file) -summary(res) + +# Downloaded \\href{ftp://www.ine.es/temas/censopv/cen11/Microdatos_personas_nacional.zip}{data} +\dontrun{ +raw <- censo2010("MicrodatosCP_NV_per_nacional_3VAR.txt") +summary(raw) +} +} +\references{ +http://www.ine.es/prodyser/microdatos.htm +} +\seealso{ +\code{\link[read_fwf]{readr}} to read fixed width files. +} +\author{ +Carlos Neira and Carlos J. Gil Bellosta } - -\keyword{ manip } diff --git a/man/defun2011.Rd b/man/defun2011.Rd index b2c9d54..5e5bddb 100644 --- a/man/defun2011.Rd +++ b/man/defun2011.Rd @@ -1,43 +1,42 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/defun2011.R \name{defun2011} \alias{defun2011} -\title{ -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. -} +\title{Download data for deaths from INE} \usage{ defun2011(file) } - \arguments{ - \item{file}{ The name of the microdata file } +\item{file}{Character string with the name of the microdata file provided by the INE on the +\href{http://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C&cid=1254736177008&menu=resultados&secc=1254736195450&idp=1254735573002}{Deaths} section. It allows either a path to a file +or literal data (single string or raw vector). It also allows compressed files in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} format.} +} +\value{ +\code{\link[tibble]{tibble}} with all avaliable requested data where each row corresponds to an anonymised citizen. +} +\description{ +This function downloads deaths statistcs from the Spanish Statistical Office (INE). } \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 \url{http://www.ine.es/en/prodyser/micro_mnp_defun_en.htm}. +This function reads deaths microdata in Spain. -It has been built and tested on the 2011 files and may be able to read files conforming to previous (or later) formats. +It was originally built using the metadata for the 2011 file and may work with microdata files for other yearly submissions. Previous files have a different, non compatible, format. +} +\note{ +The \code{file} parameter allows any flat file with fixed width. +} +\examples{ +\dontrun{ +raw <- defun2011("datos_2016.zip") # It will be automatically uncompressed. +summary(raw) } -\value{ -A \code{\link{data.frame}}. } \references{ - \url{http://www.ine.es/en/prodyser/micro_mnp_defun_en.htm} +http://www.ine.es/prodyser/microdatos.htm +} +\seealso{ +\code{\link[read_fwf]{readr}} to read fixed width files. } \author{ Carlos J. Gil Bellosta } -%\seealso{ -% \code{\link{as.data.frame.px}}, -%} -\examples{ -# This command reads a few lines sampled from the 2010 deaths microdata file -x <- defun2011(system.file("extdata", - "sampleDEFUN2010.txt", - package = "MicroDatosEs")) -summary(x) -} - -\keyword{ manip } diff --git a/man/ees2010.Rd b/man/ees2010.Rd index b275c43..cd51510 100644 --- a/man/ees2010.Rd +++ b/man/ees2010.Rd @@ -1,41 +1,41 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ees2010.R \name{ees2010} \alias{ees2010} -\title{ -Reads microdata for the EES as provided by the INE -} -\description{ -This function reads the microdata file for the "Encuesta de Estructura Salarial", ESS, survey in Spain. -} +\title{Download data from the Encuesta de Estructura Salarial (EES)} \usage{ ees2010(file) } - \arguments{ - \item{file}{ The name of the microdata file } +\item{file}{Character string with the name of the microdata file provided by the INE on the +\href{http://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C&cid=1254736177025&menu=resultados&secc=1254736195110&idp=1254735976596}{EES} section. It allows either a path to a file, +or literal data (single string or raw vector). It also allows compressed files in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} format.} +} +\value{ +\code{\link[tibble]{tibble}} with all avaliable requested data where each row corresponds to an anonymised citizen. +} +\description{ +This function downloads data from the Spanish Survey of Salary Structure using the information provided by the Spanish Statistical Office (INE). } \details{ -This function reads microdadata files for the "Encuesta de Estructura Salarial" survey by -the Spanish Statistical Office, INE. -The survey data can be downloaded from \url{http://www.ine.es/prodyser/microdatos.htm}. - -It can read the files for the 2010 survey. It might work for microdata from previous surveys (1995, 2002, 2006). +This function reads microdata from the Survey of Salary Structure in Spain. It was originally built using the metadata for 2010 file but it may be used for later years. Previous files have a different, non compatible, format. +} +\note{ +The \code{file} parameter allows any flat file with fixed width. +} +\examples{ + +\dontrun{ +raw <- ees2010("datos_2014.zip") # It will be automatically uncompressed. +summary(raw) } -\value{ -A \code{data.frame}. } \references{ - The INE page describing these microdata, \url{http://www.ine.es/prodyser/microdatos.htm}. +http://www.ine.es/prodyser/microdatos.htm } -\author{ -Carlos J. Gil Bellosta, with major contributions from Jos\'e Luis Ca\~nadas Reche. +\seealso{ +\code{\link[read_fwf]{readr}} to read fixed width files. } -%\seealso{ -% \code{\link{as.data.frame.px}}, -%} -\examples{ -# This command reads a few lines sampled from an EES file -x <- ees2010(system.file("extdata", "sampleEES2010.txt", package = "MicroDatosEs")) -summary(x) +\author{ +Carlos J. Gil Bellosta, with major contributions from José Luis Cañadas Reche } - -\keyword{ manip } diff --git a/man/epa2005.Rd b/man/epa2005.Rd index a9fde2b..4d5f0b8 100644 --- a/man/epa2005.Rd +++ b/man/epa2005.Rd @@ -1,41 +1,40 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/epa2005.R \name{epa2005} \alias{epa2005} -\title{ -Reads microdata for the EPA as provided by the INE -} -\description{ -This function reads the microdata file for the "Encuesta de Poblaci\'on Activa", EPA, survey in Spain. -} +\title{Download data from the Encuesta de Población Activa (EPA)} \usage{ epa2005(file) } - \arguments{ - \item{file}{ The name of the microdata file } +\item{file}{Character string with the name of the microdata file provided by the INE on the +\href{http://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C&cid=1254736176918&menu=resultados&secc=1254736030639&idp=1254735976595}{EPA} section. It allows either a path to a file, +or literal data (single string or raw vector). It also allows compressed files in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} format.} +} +\value{ +\code{\link[tibble]{tibble}} with all avaliable requested data where each row corresponds to an anonymised citizen. +} +\description{ +This function downloads the data from the Spanish Active Population Survey using the information provided by the Spanish Statistical Office (INE). } \details{ -This function reads microdadata files for the quarterly Encuesta de Poblaci\'on Activa survey by -the Spanish Statistical Office, INE. -The survey data can be downloaded from \url{http://www.ine.es/prodyser/microdatos.htm}. - -It can only read the files for the surveys from 2005 onwards. Previous files have a different, -non compatible, format. +This function reads microdata from the quarterly Active Population Survey in Spain. It was originally built using the metadata for 2005 file but it may be used for later years. Previous files have a different, non compatible, format. +} +\note{ +The \code{file} parameter allows any flat file with fixed width. +} +\examples{ +\dontrun{ +raw <- epa2005("EPA4T017") +summary(raw) } -\value{ -A dataframe. } \references{ - \url{http://www.ine.es/prodyser/microdatos.htm} +http://www.ine.es/prodyser/microdatos.htm +} +\seealso{ +\code{\link[read_fwf]{readr}} to read fixed width files. } \author{ Carlos J. Gil Bellosta } -%\seealso{ -% \code{\link{as.data.frame.px}}, -%} -\examples{ -# This command reads a few lines sampled from the EPA for the 1Q 2011 -sample.epa.data <- epa2005(system.file("extdata", "sampleEPA0111.txt", package = "MicroDatosEs")) -} - -\keyword{ manip } diff --git a/man/epf.2011.gastos.Rd b/man/epf.2011.gastos.Rd new file mode 100644 index 0000000..ea17286 --- /dev/null +++ b/man/epf.2011.gastos.Rd @@ -0,0 +1,40 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/epf.2011.gastos.R +\name{epf.2011.gastos} +\alias{epf.2011.gastos} +\title{Download data from the Encuesta de Presupuestos Familiares (EPF)} +\usage{ +epf.2011.gastos(file) +} +\arguments{ +\item{file}{Character string with the name of the microdata file provided by the INE on the +\href{http://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C&cid=1254736176806&menu=resultados&secc=1254736195147&idp=1254735976608}{EPF} section. It allows either a path to a file, +or literal data (single string or raw vector). It also allows compressed files in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} format.} +} +\value{ +\code{\link[tibble]{tibble}} with all avaliable requested data where each row corresponds to an anonymised citizen. +} +\description{ +This function downloads data from the Spanish Survey of Family Budgets \strong{(Expenditure approach)} using the information provided by the Spanish Statistical Office (INE). +} +\details{ +This function reads microdata from the expenditure approach of the Survey of Family Budgets in Spain. It was originally built using the metadata for 2011 file but it may be used for later years. Previous files have a different, non compatible, format. +} +\note{ +The \code{file} parameter allows any flat file with fixed width. +} +\examples{ +\dontrun{ +raw <- epf.2011.gastos("sample_gastos_a2011.txt") +summary(raw) +} +} +\references{ +http://www.ine.es/prodyser/microdatos.htm +} +\seealso{ +\code{\link[read_fwf]{readr}} to read fixed width files. +} +\author{ +Diego Paniagua Sánchez and Carlos J. Gil Bellosta +} diff --git a/man/epf.2011.hogares.Rd b/man/epf.2011.hogares.Rd index 06c99cf..e4b282b 100644 --- a/man/epf.2011.hogares.Rd +++ b/man/epf.2011.hogares.Rd @@ -1,48 +1,40 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/epf.2011.hogares.R \name{epf.2011.hogares} \alias{epf.2011.hogares} -\alias{epf.2011.gastos} -\alias{epf.2011.miembros} - -\title{ -Functions to read the Spanish survey of family budgets (EPF) microdata provided by the INE. -} - -\description{ -These functions read the Spanish survey of family budgets (EPF) microdata files, as collected by the INE. It was originally built using the metadata for the 2011 file and may work with microdata files for later yearly submissions. Microdata comes in three different files, corresponding to the three functions described here. -} - +\title{Download data from the Encuesta de Presupuestos Familiares (EPF)} \usage{ epf.2011.hogares(file) -epf.2011.gastos(file) -epf.2011.miembros(file) } - \arguments{ - \item{file}{The name of the microdata file} +\item{file}{Character string with the name of the microdata file provided by the INE on the +\href{http://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C&cid=1254736176806&menu=resultados&secc=1254736195147&idp=1254735976608}{EPF} section. It allows either a path to a file, +or literal data (single string or raw vector). It also allows compressed files in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} format.} +} +\value{ +\code{\link[tibble]{tibble}} with all avaliable requested data where each row corresponds to an anonymised citizen. +} +\description{ +This function downloads data from the Spanish Survey of Family Budgets \strong{(Homes approach)} using the information provided by the Spanish Statistical Office (INE). } - \details{ -These functions read the three microdadata files for the EPF survey in Spain. These can be downloaded from \url{http://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C&cid=1254736176806&menu=resultados&secc=1254736195147&idp=1254735976608}. It has been built and tested on the 2011 files and may be able to read files conforming to later formats. +This function reads microdata from the homes approach of the Survey of Family Budgets in Spain. It was originally built using the metadata for 2011 file but it may be used for later years. Previous files have a different, non compatible, format. +} +\note{ +The \code{file} parameter allows any flat file with fixed width. +} +\examples{ +\dontrun{ +raw <- epf.2011.gastos("sample_hogares_a2011.txt") +summary(raw) } -\value{ -A \code{data.frame}. } - \references{ -\url{http://www.ine.es/metodologia/t25/t2530p458.pdf} +http://www.ine.es/prodyser/microdatos.htm +} +\seealso{ +\code{\link[read_fwf]{readr}} to read fixed width files. } \author{ Diego Paniagua Sánchez and Carlos J. Gil Bellosta } -%\seealso{ -% \code{\link{as.data.frame.px}}, -%} -\examples{ -# This command reads a few lines sampled from -# the households EPF file for 2011 -x<- epf.2011.hogares(system.file("extdata", - "sample_hogares_a2011.txt", - package = "MicroDatosEs") ) -summary(x) -} -\keyword{ manip } diff --git a/man/epf.2011.miembros.Rd b/man/epf.2011.miembros.Rd new file mode 100644 index 0000000..9a1d614 --- /dev/null +++ b/man/epf.2011.miembros.Rd @@ -0,0 +1,40 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/epf.2011.miembros.R +\name{epf.2011.miembros} +\alias{epf.2011.miembros} +\title{Download data from the Encuesta de Presupuestos Familiares (EPF)} +\usage{ +epf.2011.miembros(file) +} +\arguments{ +\item{file}{Character string with the name of the microdata file provided by the INE on the +\href{http://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C&cid=1254736176806&menu=resultados&secc=1254736195147&idp=1254735976608}{EPF} section. It allows either a path to a file, +or literal data (single string or raw vector). It also allows compressed files in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} format.} +} +\value{ +\code{\link[tibble]{tibble}} with all avaliable requested data where each row corresponds to an anonymised citizen. +} +\description{ +This function downloads data from the Spanish Survey of Family Budgets \strong{(Members approach)} using the information provided by the Spanish Statistical Office (INE). +} +\details{ +This function reads microdata from the members approach of the Survey of Family Budgets in Spain. It was originally built using the metadata for 2011 file but it may be used for later years. Previous files have a different, non compatible, format. +} +\note{ +The \code{file} parameter allows any flat file with fixed width. +} +\examples{ +\dontrun{ +raw <- epf.2011.gastos("sample_miembros_a2011.txt") +summary(raw) +} +} +\references{ +http://www.ine.es/prodyser/microdatos.htm +} +\seealso{ +\code{\link[read_fwf]{readr}} to read fixed width files. +} +\author{ +Diego Paniagua Sánchez and Carlos J. Gil Bellosta +} diff --git a/man/padron2016.Rd b/man/padron2016.Rd index e495411..7d6e2c3 100644 --- a/man/padron2016.Rd +++ b/man/padron2016.Rd @@ -1,37 +1,40 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/padron2016.R \name{padron2016} \alias{padron2016} -\title{ -Reads microdata for the "padrón" as provided by the INE -} -\description{ -This function reads the microdata file for the "padrón" as provided by the INE. -} +\title{Download data from the "Padrón"} \usage{ padron2016(file) } - \arguments{ - \item{file}{ The name of the microdata file } +\item{file}{Character string with the name of the microdata file provided by the INE on the +\href{http://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C&cid=1254736177012&menu=resultados&secc=1254736195462&idp=1254734710990}{Padrón} section. It allows either a path to a file, +or literal data (single string or raw vector). It also allows compressed files in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} format.} +} +\value{ +\code{\link[tibble]{tibble}} with all avaliable requested data where each row corresponds to an anonymised citizen. +} +\description{ +This function downloads data from the Spanish "padrón" using the information provided by the Spanish Statistical Office (INE). } \details{ -TBA +This function reads microdata from the members approach of the "Padrón" in Spain. It was originally built using the metadata for 2016 file but it may be used for later years. Previous files have a different, non compatible, format. +} +\note{ +The \code{file} parameter allows any flat file with fixed width. +} +\examples{ +\dontrun{ +raw <- epf.2011.gastos("sample_padron_2016.txt") +summary(raw) } -\value{ -A dataframe. } \references{ - \url{http://www.ine.es/prodyser/microdatos.htm} +http://www.ine.es/prodyser/microdatos.htm +} +\seealso{ +\code{\link[read_fwf]{readr}} to read fixed width files. } \author{ Carlos J. Gil Bellosta; metadata provided by Fiorella Mori. } -%\seealso{ -% \code{\link{as.data.frame.px}}, -%} -\examples{ -# This command reads a few lines sampled from the "padrón" of 2016. -sample.epa.data <- padron2016(system.file("extdata", - "sample_padron_2016.txt", package = "MicroDatosEs")) -} - -\keyword{ manip }