get_all_registries: Retrieves the number of registries in ARPEN website.

Description Usage Arguments Value Examples

View source: R/get_data_functions.R

Description

Retrieves the number of the recorded vital events (all, births, marriages, and deaths) available at the ARPEN website https://transparencia.registrocivil.org.br/registros according to the arguments provided.

The functions work by navigating to the ARPEN website and filling the form in order to generate a scrapable webpage.

The functions take a pre-initialized webDriver from the RSelenium package (see example).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
get_all_registries(
  rd = NULL,
  year = "2020",
  month = "Todos",
  state = "Todos",
  wait = 10L
)

get_births(
  rd = NULL,
  year = "2020",
  month = "Todos",
  state = "Todos",
  wait = 10L
)

get_marriages(
  rd = NULL,
  year = "2020",
  month = "Todos",
  state = "Todos",
  wait = 10L
)

get_deaths(
  rd = NULL,
  year = "2020",
  month = "Todos",
  state = "Todos",
  wait = 10L
)

Arguments

rd

An initialized RSelenium webdriver.

year

A numerical or character representing the year you want to retrieve the registries from.

month

A character representing the month name in Portuguese or "Todos" for retrieving data from all the months in the selected year.

state

A character representing the State name in Portuguese or "Todos" for retrieving data from all states.

wait

An integer representing how long to wait before starting the scraping operation after reaching the Brazilian Association of Civil Registries website.

Value

A data frame containing the requested data. If no data was found, an empty data frame is returned.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
rs <- RSelenium::rsDriver(browser = "firefox")
rd <- rs$client

get_all_registries(rd, "2018", "Janeiro", "Acre")
get_deaths(rd, "2020", "Maio", "Todos")

rd$quit()
rd$server$stop()

## End(Not run)

samirarman/arpenr documentation built on Aug. 6, 2020, 1:17 p.m.