Learn R Programming

EpiForsk

This package is a framework for sharing guides, examples, and functions here at EpiForsk. It is primarily managed by ADLS and KIJA, but is intended to be a collaborative effort and we encourage sharing your hard earned code snippets.

Availability

The package is available on CRAN.

Installation & Use

CRAN version

To install the package write

install.packages("EpiForsk")

And to load the package write

library("EpiForsk")

Latest version

The latest version of the package can be installed directly from github:

# install.packages("devtools")
devtools::install_github("Laksafoss/EpiForsk")

What is already in the package

The package is (hopefully) constantly under development. To see all content currently available in the package use

help(package = "EpiForsk")

What is suited for the package

There is a strict ban on any and all individual level information! Your code and examples should strive to be as general as possible to avoid project and person specific information.

Highly specialized code is allowed in the package, but we strongly encourage you to make it useful to your colleagues by striving to strip it of project specific details, allowing for generally transferable ideas to shine through.

A high priority is to have the package hosted on CRAN, which imposes certain limitations on it. One such is its size, which is currently limited by CRAN at 100 MB. As the popularity of this initiative (hopefully) grows, we may reconsider what will be allowed in the package.

There are two main formats for contributing:

Vignettes

Vignettes are a loose format guide with both description text and examples. In vignettes we share examples of typical data management, analysis methods, and other blog/article style walkthroughs.

Functions

Functions automate common tasks the frequently occur in our daily work. These will work as any other functions made available by other packages in R. However, the goal is not to make the sleekest, fastest and most efficient versions of these functionalists, but rather implement functionalists tailored to our specific needs.

How to contribute

We encourage you to write your contribution yourself. To get started, read the "contributing" vignette. If this is out of scope, you are welcome to contact ADLS or KIJA and we talk about possible solutions.

Requirements for contributions

The package MUST be self-sufficient. This means that any data you wish to use in your examples should either be simulated in the example (preferred) or made available as a dummy data set within the package (only if small).

In general we follow Hadley's guide for package writing, and this book contains a plethora of good advice.

Functions

As the package must comply with the CRAN check rules all functions must have a documentation. Moreover, we require that this documentation is made via Roxygen2 and contains one or more examples.

Vignettes

So far we have no formal requirements for vignettes.

Copy Link

Version

Install

install.packages('EpiForsk')

Monthly Downloads

231

Version

0.2.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Kim Daniel Jakobsen

Last Published

August 20th, 2025

Functions in EpiForsk (0.2.0)

many_merge

Merging Many Data Frames with Name Handling
floor_dec

Round numbers down to a given number of decimal places
charlson_score

Charlson Score Constructor
odds_ratio_function

Easier to perform logistic and log-linear regressions giving a standardized output table
lms

Wrapper around lm for sibling design
odds_ratio_function_repeated

Wrapper for the odds_ratio_function()to perform several similar analyses in one go
flatten_date_intervals

Flatten Date Intervals
fct_confint

Confidence set for functions of model parameters
freq_function_repeated

Wrapper for freq_function() to get frequencies for many variables in one go.
summary.svy_vglm

Summary function for svy_vglm objects
freq_function

Frequency Tables with Percentage and Odds Ratios
vcovHC

Heteroscedasticity-Consistent Covariance Matrix
try_catch_warnings

Try Catch with Warning Handling
multi_join

Join many data frames with name handling
DiscreteCovariatesToOneHot

One-hot encode factors
CATESurface

Calculate CATE on a surface in the covariate space
CausalForestDynamicSubgroups

Calculate CATE in dynamically determined subgroups
RATETest

wrapper for rank_average_treatment_effect
DiscreteCovariateNames

Extract discrete covariate names
ListPermute

Permute the levels of a nested list
EpiForsk-package

EpiForsk
CovariateBalance

Plots for checking covariate balance in causal forest
RATEOmnibusTest

RATE based omnibus test of heterogeneity
CForBenefit

c-for-benefit
andh_forest_data

Example Data for Husby's Forest Plot Vignette
ci_fct_error_handler

Handle errors returned by ci_fct
ci_fct

solve optimization problem for CI bounds
ceiling_dec

Round numbers up to a given number of decimal places
.datatable.aware

make package data table aware
braid_rows

Bind lists of list of multiple data frames by row
decimalplaces

Determine number of decimal places
adls_timevarying_region_data

Simulated Time-Varying Residence Data
logasympBF

Asymptotic Bayes factors