Skip to content

jonas7654/regmodelsuite

Repository files navigation

Introduction

This Repository contains the regmodelsuite Package

R Package tutorial

Useful commands in order to create a R package.

  1. devtools package
install.packages(c("devtools", "roxygen2", "testthat", "knitr"))
  1. Install packages
devtools::install_github(path) #
devtools::install(path) # Install source package
devtools::install_local(path) # Install Developerversion (.tar.gz)
  1. Build
devtools::build() # Build as .tar.gz
devtools:build(binary = TRUE) # Build as binary. Depends on OS
usethis::create_package() # Helper function which creates a package related folder. Creates an .Rproj file to work in RStudio.
usethis::use_r() # Create a new .R Script within the Package.
devtools::load_all() # Reload all Scripts within the current session
devtools::check() # Checks if the package meets the standard requirements

Alt Text 4) Checking Should be done regularly in order to check if the package is still valid.

devtools::check() # Runs R CMD check 

Function template

The main function accepts a formula and other parameters

functionWrapper(y ~ x, lambda, cv, data, ...) {
mframe <- model.frame(formula, data = data)

      # get the model matrix
      X <- model.matrix(formula, data = data)
      # get the response variable (lhs of the formula)
      y <- model.response(mframe)
}

the function then extracts the model matrix X and response vector y which then can be passed to other functions for estimation

ridge(X, y, lambda) ...

About

No description, website, or topics provided.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages