social_media: Download data on the candidates' social media links in...

View source: R/social_media.R

social_mediaR Documentation

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)

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.

Value

social_media() returns a tbl, data.frame.

Examples

## Not run: 
df <- social_media(2022)

## End(Not run)

electionsBR documentation built on May 29, 2024, 7:16 a.m.