1 Introduction

This book uses literate programming1 to implement the R package associated with the paper “Quantifying Uncertainty and Stability Among Highly Correlated Predictors: A Subspace Perspective.”

Note: The following line of code when run in R from the directory containing this and the other .Rmd files will create (a) a bookdown (a “book” that can be viewed in a web broswer) and (b) the substab R package.

litr::render("index.Rmd", output_format = litr::litr_gitbook())

Once the rendering process completes, open _book/index.html in a web browser to see the result and you can run the following to install the R package.

devtools::install("substab/")

The basic outline of this document is as follows:

Before proceeding, we define some important package metadata.

1.1 Package setup

Every R package needs a DESCRIPTION file, so we start by specifying this information:

usethis::create_package(
  path = ".",
  fields = list(
    Package = params$package_name,
    Version = "0.0.0.9000",
    Title = "A Package for Stable Feature Subspace Selection",
    Description = "This package implements the proposals in the paper, 'Quantifying Uncertainty and Stability Among Highly Correlated Predictors: A Subspace Perspective.'",
    `Authors@R` = c(
      person(given = "Xiaozhu",
             family = "Zhang",
             email = "xzzhang@uw.edu",
             role = c("aut", "cre")),
      person(given = "Jacob", family = "Bien", role = "ctb"),
      person(given = "Armeen", family = "Taeb", role = "ctb")
      )
  )
)
usethis::use_mit_license(copyright_holder = "X. Zhang")

We start by creating some package-level documentation. This is what will show up when someone types package?substab in the console.

#' A Package for Stable Feature Subspace Selection
#'
#' This package implements the proposals in the paper, 'Quantifying Uncertainty
#' and Stability Among Highly Correlated Predictors: A Subspace Perspective.' It 
#' is focused on feature selection in the setting where features are highly
#' correlated.  It addresses the challenge of feature selection by shifting the 
#' perspective from selecting certain features to selecting a certain subspace
#' of R^n.
#' 
#' @docType package

  1. Using the litr R package↩︎