Desagregados_Mesa_Mir {Relectoral} | R Documentation |
Download. Disaggregated data at polling station level obtained from the MIR (Spanish Ministry of Home Office)
Description
This function serves to download the data in Excel format at polling station level and then uploads a data.frame with that information into R. Note: The returned fields are all of character format, so if you need to perform numeric operations, you will have to convert the required fields to numeric.
Usage
Desagregados_Mesa_Mir(Ano, Mes, Tipo, Ruta, Borrar = TRUE)
Arguments
Ano |
The election year in four-digit format (YYYY). Can be numeric or text. |
Mes |
The election month. It has to be of character format. For example "06", corresponding to June. |
Tipo |
The type of elections to which the data to be downloaded correspond: Congress (you must pass to the function the word "Congreso") or European (you must pass to the function the word "Europeas"). |
Ruta |
It is the local path from your computer where the zip files from the Spanish Ministry of Home Office (MIR) will be dowloaded. |
Borrar |
It is a Boolean variable that indicates whether or not the downloaded files are deleted after creating the data.frame in R. |
Value
Object of type 'tbl_df' with the data at polling station level.
Examples
c2<-Desagregados_Mesa_Mir(2019,"04",Tipo = "Congreso", Ruta = "F:/",Borrar = TRUE)