governor: Extract data of Brazilian gubernatorial polls.

Description Usage Arguments Value Examples

View source: R/governor.R

Description

governor() extracts data of Brazilian gubernatorial polls from the Poder 360's poll agreggator API (https://www.poder360.com.br/pesquisas-de-opiniao/api/). The function returns a data.frame where each observation corresponds to a candidate's estimate in a poll.

Usage

1
governor(year, state = "ALL", round = c(1, 2), type = c(1, 2, 3))

Arguments

year

Election year (integer). Available years are 2002, 2006, 2010, 2014, 2018.

state

Initials in capital letters (character) of the state where the poll was conducted. Default returns all gubernatorial polls for the corresponding election year.

round

Number (integer) corresponding to the election round that was polled. Default returns polls for both first and second rounds.

type

Number (character) indicating if the user wants the spontaneous (1), estimulated (2), or rejection (3) estimations of polls. Default returns all poll results.

Value

data.frame with results from polls conducted for gubernatorial elections in Brazil, for the year specified, with the following variables:

Examples

1
2
3
4
5
6
7
8
# returns a data.frame with the results for all gubernatorial polls conducted
# in the 2018 elections
df <- governor(2018)


# returns a data.frame with results for all polls for the first round of 2014
# Minas Gerais' governor elections with candidates' rejection estimates
df <- governor(2014, state = "MG", round = 1, type = 3)

voltdatalab/pollingbr documentation built on April 1, 2021, 4:38 a.m.