Package 'ecdata'

Title: Loads Data from the Executive Communications Dataset
Description: A minimal package for downloading data from 'GitHub' repositories of the Executive Communications Database.
Authors: Joshua Allen [aut, cre, cph] , Ryan Carlin [ctb], Juan Gomez-Gómez-Cruces [ctb], Will Horne [aut, ctb], Jamie Lindh [ctb], Cecilia Martinez-Gallardo [ctb], Miles Massesy [ctb]
Maintainer: Joshua Allen <[email protected]>
License: CC BY 4.0
Version: 1.1.1
Built: 2025-01-12 06:27:31 UTC
Source: https://github.com/cranhaven/cranhaven.r-universe.dev

Help Index


Clear function cache

Description

This function clears the memoised cache of all functions memoised by ecdata.

Usage

clear_cache()

Value

A success message after clearing the cache.

Examples

## Not run: 
clear_cache()

## End(Not run)

ECD country dictionary A data dictionary with the countries in our dataset and their corresponding file names on Github

Description

a data frame with 41 rows and 2 columns

name_in_dataset

Name of the country in the dataset

file_name

Name of the parquet files on GitHub

Usage

ecd_country_dictionary

Format

An object of class data.frame with 45 rows and 7 columns.

Source

The Executive Communications Dataset


ECD data dictionary a data dictionary of the columns in our dataset

Description

country

name of a country in our dataset

date

date of statement

title

title of the statement

text

text of the statement

url

url of the statement

file

name of the file in the replication repo

Usage

ecd_data_dictionary

Format

An object of class tbl_df (inherits from tbl, data.frame) with 13 rows and 2 columns.

Source

The Executive Communications Dataset


This is a helper function to help you scrape the web

Description

opens and example web scraper in your text editor

Usage

example_scraper(scrapper_type = c("static", "dynamic"))

Arguments

scrapper_type

calls the example scrapper scripts. Should be one of static or dynamic which matches the kind of scrapper you want to use

Value

an example webscrapper

Examples

#'
## Not run: 
library(ecdata)

# get dynamic scrapper

example_scrapper(scrapper_type = 'static')


## End(Not run)

Reading Executive Communications Dataset lazily This function imports data from the ECD lazily meaning the data is out loaded out of memory

Description

Reading Executive Communications Dataset lazily

This function imports data from the ECD lazily meaning the data is out loaded out of memory

Usage

lazy_load_ecd(
  country = NULL,
  language = NULL,
  full_ecd = FALSE,
  ecd_version = "1.0.0"
)

Arguments

country

a character vector with a country or countries in our dataset to download.

language

a character vector with a lanaguage or languages in our dataset to download.

full_ecd

to download the full Executive Communications Dataset set full_ecd to TRUE

ecd_version

a character of ecd versions.

Value

A tibble with the specified country/countries or language/languages

Examples

library(ecdata)

## load one country 

load_ecd(country = 'United States of America')

## displays data from the USA


## load multiple countries 

load_ecd(country = c('Turkey', 'Republic of South Korea', 'India'))

## displays data from Turkey, South Korea, and India

# load full ecd 


load_ecd(full_ecd = TRUE)

Reading Executive Communications Dataset This function imports data from the ECD

Description

Reading Executive Communications Dataset

This function imports data from the ECD

Usage

load_ecd(
  country = NULL,
  language = NULL,
  full_ecd = FALSE,
  ecd_version = "1.0.0"
)

Arguments

country

a character vector with a country or countries in our dataset to download.

language

a character vector with a lanaguage or languages in our dataset to download.

full_ecd

to download the full Executive Communications Dataset set full_ecd to TRUE

ecd_version

a character of ecd versions.

Value

A tibble with the specified country/countries or language/languages

Examples

library(ecdata)

## load one country 

load_ecd(country = 'United States of America')

## displays data from the USA


## load multiple countries 

load_ecd(country = c('Turkey', 'Republic of South Korea', 'India'))

## displays data from Turkey, South Korea, and India

# load full ecd 


load_ecd(full_ecd = TRUE)