social_media: Download data on the candidates' social media links in federal elections
Description
social_media() is a function that allows you to download data on the social media handles of candidates participating in federal and municipal elections in Brazil. The function returns a data.frame where each observation corresponds to a candidate's social media handles (i.e., usernames).
Usage
social_media(year, encoding = "latin1", temp = TRUE, readme_pdf = FALSE)
Value
social_media() returns a tbl, data.frame.
Arguments
- year
Election year (integer). For this function, only the years 2020 and 2022
are available.
- encoding
Data original encoding (defaults to 'latin1'). This can be changed to avoid errors
when ascii = TRUE.
- temp
(logical). Whether to keep the temporary data files for future use (recommended).
- readme_pdf
should the original README file be saved as a PDF in the working directory? Defaults to FALSE.
Details
If export is set to TRUE, the downloaded data is saved as .dta and .sav
files in the current directory.
Examples
Run this codeif (FALSE) {
df <- social_media(2022)
}
Run the code above in your browser using DataLab