Package 'pacta.data.scraping'

Title: Scrapes data from various web sources needed for PACTA
Description: This package provides tools to scrape data from various web sources needed for PACTA.
Authors: CJ Yetman [aut, cre, ctr] , Jackson Hoffart [aut, ctr] , Jacob Kastl [aut, ctr], Alex Axthelm [aut, ctr] , RMI [cph, fnd]
Maintainer: CJ Yetman <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0.9000
Built: 2024-10-30 12:23:46 UTC
Source: https://github.com/rmi-pacta/pacta.data.scraping

Help Index


Get currency exchange rates for a given quarter from the IMF API

Description

Get currency exchange rates for a given quarter from the IMF API

Usage

get_currency_exchange_rates(quarter, max_seconds = 60L)

Arguments

quarter

A single string containing the desired quarter of data in the form "2022-Q4".

max_seconds

A single numeric containing the max number of seconds it should wait for a response

Value

A dataframe containing columns currency and exchange_rate


Get the definition of MSCI regions (in terms of member countries)

Description

Get the definition of MSCI regions (in terms of member countries)

Usage

get_index_regions()

Value

A dataframe containing columns equity_market, country, and country_iso


Scrape index data from the iShares website

Description

This function will scrape and process holdings data from the iShares website.

Usage

get_ishares_index_data(url, name, as_of_date)

Arguments

url

A string containing the url of the desired iShares index data.

name

A string containing the name of the index.

as_of_date

A string indicating the desired date, by year, month and date, "YYYYMMDD" (e.g. "20201231"). Data will be scraped for date specified.

Value

A data.frame, containing the un-processed iShares data.

Examples

## Not run: 
url <-
  paste0(
    "https://www.ishares.com/uk/individual/en/products/",
    "251813/ishares-global-corporate-bond-ucits-etf/"
  )
name <- "iShares Global Corporate Bond UCITS ETF <USD (Distributing)>"
as_of_date <- "20211231"

get_ishares_index_data(url, name, as_of_date)

## End(Not run)

Process raw iShares data into PACTA readable format

Description

Process raw iShares data into PACTA readable format

Usage

process_ishares_index_data(data)

Arguments

data

An iShares index dataset, like the output of get_ishares_index_data().

Value

A processed dataset, formatted for input into pacta.portfolio.analysis.