tidyfinance

R package with helper functions for developers and researchers familiar with Tidy Finance

https://github.com/tidy-finance/r-tidyfinance

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.8%) to scientific vocabulary

Keywords

finance r
Last synced: 5 months ago · JSON representation

Repository

R package with helper functions for developers and researchers familiar with Tidy Finance

Basic Info
Statistics
  • Stars: 16
  • Watchers: 4
  • Forks: 5
  • Open Issues: 1
  • Releases: 1
Topics
finance r
Created about 2 years ago · Last pushed 8 months ago
Metadata Files
Readme License

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# tidyfinance


`r badger::badge_cran_release()`
`r badger::badge_cran_download(type = "grand-total")`
`r badger::badge_repostatus("Active")`
`r badger::badge_github_version(color = "blue")`
[![R-CMD-check](https://github.com/tidy-finance/r-tidyfinance/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tidy-finance/r-tidyfinance/actions/workflows/R-CMD-check.yaml)


This repository contains an R package that collects helper functions for developers and researchers familiar with [Tidy Finance with R](https://www.tidy-finance.org/r/index.html). The functions provide shortcuts to selected issues that the book discusses in detail.

## Installation

You can install the released version of `tidyfinance` [from CRAN](https://cran.r-project.org/package=tidyfinance) via:

```r
install.packages("tidyfinance")
```

You can install the development version of `tidyfinance` from [GitHub](https://github.com/tidy-finance/r-tidyfinance) via:

```r
# install.packages("pak")
pak::pak("tidy-finance/r-tidyfinance")
```

## Usage

Load the package:

```r
library(tidyfinance)
```

### Download Data

The main functionality of the `tidyfinance` package centers around data download. You can download most of the data that we used in [Tidy Finance with R](https://www.tidy-finance.org/r/index.html) using the `download_data()` function or its children. For instance, both functions give the same result:

```r
download_data(
  type = "factors_ff_3_monthly", 
  start_date = "2000-01-01", 
  end_date = "2020-12-31"
)

download_data_factors_ff(
  type = "factors_ff_3_monthly", 
  start_date = "2000-01-01", 
  end_date = "2020-12-31"
)
```

You can also download data directly from [WRDS](https://www.tidy-finance.org/r/wrds-crsp-and-compustat.html) (if you have set your credentials via `Sys.setenv(WRDS_USER = "your_username", WRDS_PASSWORD = "your_password")`), e.g.,

```r
download_data(
  type = "wrds_compustat_annual", 
  start_date = "2000-01-01", 
  end_date = "2020-12-31"
)
```

If you want to fetch additional columns that are not included in our default selection, then pass them as additional arguments in the corresponding child function:

```r
download_data_wrds_compustat(
  type = "wrds_compustat_annual",  
  start_date = "2000-01-01", 
  end_date = "2020-12-31",
  additional_columns = c("acoxar", "amc", "aldo")
)
```

You can get a list of all currently supported types via `list_supported_types()`. Please open an [issue on GitHub](https://github.com/tidy-finance/r-tidyfinance/issues) to request additional supported types.

### Other Helpers

We include functions to check out content from [tidy-finance.org](https://www.tidy-finance.org/r/index.html):

```r
list_tidy_finance_chapters()
open_tidy_finance_website()
```

There are also some simple helpers for regression analyses:

```r
winsorize()
trim()
create_summary_statistics()
```

We also include (experimental) functions that can be used for different applications, but note that they might heavily change in future package versions as we try to make them more general:

```r
# For portfolio sorts
?assign_portfolio()

# For model estimation
?estimate_model()

# For beta estimation
?estimate_betas()

# For beta estimation
?estimate_fama_macbeth()
```

Owner

  • Name: Tidy Finance
  • Login: tidy-finance
  • Kind: organization
  • Email: contact@tidy-finance.org

GitHub Events

Total
  • Create event: 12
  • Release event: 3
  • Issues event: 14
  • Watch event: 5
  • Delete event: 8
  • Issue comment event: 5
  • Push event: 26
  • Pull request event: 15
  • Fork event: 2
Last Year
  • Create event: 12
  • Release event: 3
  • Issues event: 14
  • Watch event: 5
  • Delete event: 8
  • Issue comment event: 5
  • Push event: 26
  • Pull request event: 15
  • Fork event: 2

Packages

  • Total packages: 2
  • Total downloads:
    • cran 586 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 18
  • Total maintainers: 1
proxy.golang.org: github.com/tidy-finance/r-tidyfinance
  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago
cran.r-project.org: tidyfinance

Tidy Finance Helper Functions

  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 586 Last month
Rankings
Dependent packages count: 28.1%
Dependent repos count: 36.1%
Average: 49.7%
Downloads: 84.9%
Maintainers (1)
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 4.1 depends
  • dplyr >= 1.1.4 imports
  • lifecycle * imports
  • lubridate >= 1.9.3 imports
  • purrr >= 1.0.2 imports
  • rlang >= 1.1.3 imports
  • tibble >= 3.2.1 imports
  • tidyr >= 1.3.0 imports
  • DBI >= 1.1.0 suggests
  • RPostgres >= 1.4.5 suggests
  • dbplyr >= 2.3.2 suggests
  • frenchdata >= 0.2.0 suggests
  • readxl >= 1.4.2 suggests
  • testthat >= 3.0.0 suggests