Thank you for your interest in contributing to EpiAwareR! This document provides guidelines for contributing to the project.
By participating in this project, you agree to maintain a respectful and inclusive environment for all contributors.
If you find a bug, please open an issue with:
sessionInfo() output)We welcome suggestions for new features! Please:
epiaware_call()
git checkout -b feature/my-feature
devtools::check()
Follow standard R conventions:
snake_case for user-facing functions. (e.g., .internal_helper)snake_case
SCREAMING_SNAKE_CASE
All exported functions must have roxygen2 documentation:
#' Brief Title
#'
#' Detailed description of what the function does.
#'
#' @param param1 Description of param1
#' @param param2 Description of param2
#'
#' @return Description of return value
#'
#' @examples
#' \dontrun{
#' # Example usage
#' result <- my_function(param1 = 1, param2 = 2)
#' }
#'
#' @export
my_function <- function(param1, param2) {
# Implementation
}EpiAwareR uses S3 classes for simplicity:
julia_ref
c("epiaware_ar", "epiaware_latent", "epiaware_model"))print() methodstests/testthat/test-*.R
test_that("function validates inputs", { ... })
skip_on_cran()
skip_if_not(epiaware_available())
# Run all tests
devtools::test()
# Run specific test file
testthat::test_file("tests/testthat/test-components.R")
# Check package
devtools::check()R/latent-models.R).to_julia_dist()
.call_julia_function()
tests/testthat/
Example structure:
#' My New Model
#'
#' @param param1 Description
#' @export
MyNewModel <- function(param1) {
# Validate
if (!is.numeric(param1)) stop("param1 must be numeric")
# Convert to Julia
julia_obj <- .call_julia_function("MyNewModel", param1 = param1)
# Return S3 object
structure(
list(julia_ref = julia_obj, spec = list(param1 = param1)),
class = c("epiaware_mynew", "epiaware_latent", "epiaware_model")
)
}
#' @export
print.epiaware_mynew <- function(x, ...) {
cat("<EpiAware My New Model>\n")
cat(" Param1:", x$spec$param1, "\n")
invisible(x)
}For features not yet wrapped, users can use epiaware_call():
custom_model <- epiaware_call("JuliaFunction", param1 = value1)Document these in the function reference with guidance on when explicit wrappers are warranted.
DESCRIPTION
NEWS.md with changesdevtools::check() with no errors, warnings, or notesdevtools::check()
If you have questions about contributing: