The R package
muniSpain is designed to deal with territorial changes in Spanish municipalities when working with historical local-level data from different periods.
It relies on the municipality codes from the Instituto Nacional de Estadística (INE) and the list of municipality changes compiled and corrected by Francisco J. Goerlich and Francisco Ruiz (see Goerlich and Ruiz 2018 and the package readme file for more information).
The package also allows converting municipality names (including old and multi-language denominations) to INE codes.
More information and installation on the Github repository.
R code to get the territorial origins of Spanish surnames from the INE database, used to determined whether a family names is territorially concentrated in any region in Spain (see e.g. this article for an application). The scraping relies on RSelenium.
Here I offer details, R scripts and raw data on historical patterns of violence and political behavior in Spain. It includes, among others, disaggregated data on civilian victimization during the Spanish Civil War, presence of trade unions in the 1930s or prewar electoral results.