Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Johann D. Gaebler committed Jan 17, 2024
0 parents commit 16e4a8b
Show file tree
Hide file tree
Showing 56 changed files with 4,993 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
^LICENSE\.md$
^cran-comments\.md$
^_pkgdown\.yml$
^docs$
^logo$
^pkgdown$
^README\.Rmd$
^codecov\.yml$
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
29 changes: 29 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
48 changes: 48 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
clean: false
branch: gh-pages
folder: docs
53 changes: 53 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: |
covr::codecov(
token = Sys.getenv("CODECOV_TOKEN"),
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # Add this line
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.Rproj.user
.Rhistory
.Rdata
.httr-oauth
.DS_Store
.quarto
README.html
docs
logo
35 changes: 35 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Package: rar
Title: Risk-Adjusted Regression
Version: 0.0.1
Authors@R:
person("Johann", "Gaebler", , "me@jgaeb.com", role = c("aut", "cre", "cph"),
comment = c(ORCID = "0000-0003-3340-9542"))
Description: Perform risk-adjusted regression and sensitivity analysis as
developed in "Mitigating Omitted- and Included-Variable Bias in Estimates of
Disparate Impact" Jung et al. (2024) <arxiv:1809.05651>.
License: MIT + file LICENSE
Encoding: UTF-8
URL: https://rar.jgaeb.com, https://github.com/jgaeb/rar
BugReports: https://github.com/jgaeb/rar/issues
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
LinkingTo:
cpp11,
testthat
Suggests:
broom,
forcats,
stringr,
testthat (>= 3.0.0),
xml2
Config/testthat/edition: 3
Imports:
dplyr,
glue,
magrittr,
purrr,
rlang,
tibble,
tidyr,
tidyselect,
vctrs
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YEAR: 2023
COPYRIGHT HOLDER: Johann D. Gaebler
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright (c) 2023 Johann D. Gaebler

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
29 changes: 29 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generated by roxygen2: do not edit by hand

export(sens)
importFrom(dplyr,anti_join)
importFrom(dplyr,arrange)
importFrom(dplyr,bind_cols)
importFrom(dplyr,filter)
importFrom(dplyr,group_by)
importFrom(dplyr,mutate)
importFrom(dplyr,n_distinct)
importFrom(dplyr,pull)
importFrom(dplyr,rename)
importFrom(dplyr,select)
importFrom(dplyr,slice_sample)
importFrom(dplyr,summarize)
importFrom(glue,glue)
importFrom(magrittr,"%>%")
importFrom(purrr,map_dfr)
importFrom(rlang,abort)
importFrom(rlang,as_name)
importFrom(rlang,enquo)
importFrom(rlang,quo_is_null)
importFrom(rlang,quo_text)
importFrom(rlang,set_names)
importFrom(rlang,warn)
importFrom(tibble,tibble)
importFrom(tidyr,expand_grid)
importFrom(vctrs,vec_is)
useDynLib(rar, .registration = TRUE)
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# rar 0.0.1

* Initial CRAN submission.
6 changes: 6 additions & 0 deletions R/catch-routine-registration.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This dummy function definition is included with the package to ensure that
# 'tools::package_native_routine_registration_skeleton()' generates the required
# registration info for the 'run_testthat_tests' symbol.
(function() {
.Call("run_testthat_tests", FALSE, PACKAGE = "rar")
})
5 changes: 5 additions & 0 deletions R/cpp11.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Generated by cpp11: do not edit by hand

sens_ <- function(e, lwr, upr, lwr_iter, upr_iter, grp, a, epsilon, eta, m, chunk_size, num_threads) {
.Call(`_rar_sens_`, e, lwr, upr, lwr_iter, upr_iter, grp, a, epsilon, eta, m, chunk_size, num_threads)
}
7 changes: 7 additions & 0 deletions R/rar-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#' @useDynLib rar, .registration = TRUE
NULL

## usethis namespace: start
#' @importFrom magrittr %>%
## usethis namespace: end
NULL
Loading

0 comments on commit 16e4a8b

Please sign in to comment.