if ("remotes" %in% installed.packages()[,'Package'] == FALSE) install.packages("remotes")
if ("MicroDatosEs" %in% installed.packages()[,'Package'] == FALSE) remotes::install_github("rOpenSpain/MicroDatosEs")
library(MicroDatosEs)
raw <- defun2011(system.file("extdata/sampleDEFUN2010.txt", package = "MicroDatosEs"))
#> Error in assign.labels(dat[[colname]], mdat.2[mdat.2$var == colname, ]): A column cannot have more than a single type: check metadata file for inconsistencies.
raw <- epf.2011.gastos(system.file("extdata/sample_gastos_a2011.txt", package = "MicroDatosEs"))
#> Error in if (!tipo %in% c("D", "N", "HHMM")) stop("Column types can only be D (key-value), N (numeric) or HHMM (hour-minute)."): argument is of length zero
raw <- epf.2011.miembros(system.file("extdata/sample_miembros_a2011.txt", package = "MicroDatosEs"))
#> Error in if (!tipo %in% c("D", "N", "HHMM")) stop("Column types can only be D (key-value), N (numeric) or HHMM (hour-minute)."): argument is of length zero
Following the issue https://github.com/rOpenSpain/MicroDatosEs/issues/6 , I have found a few more problems:
Created on 2023-04-21 with reprex v2.0.2
This is due to minor errors and some missing lines in metadata files.