Skip to content

Commit

Permalink
documentation of package and data now also generated via roxygen2
Browse files Browse the repository at this point in the history
  • Loading branch information
aalfons committed Aug 9, 2022
1 parent cd340ee commit a782428
Show file tree
Hide file tree
Showing 7 changed files with 272 additions and 96 deletions.
80 changes: 80 additions & 0 deletions R/TopGear.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# --------------------------------------
# Author: Andreas Alfons
# Erasmus Universiteit Rotterdam
# --------------------------------------

#' Top Gear car data
#'
#' @description
#' The data set contains information on cars featured on the website of the
#' popular BBC television show \emph{Top Gear}.
#'
#' @usage
#' data("TopGear")
#'
#' @format
#' A data frame with 297 observations on the following 32 variables.
#' \describe{
#' \item{\code{Maker}}{factor; the car maker.}
#' \item{\code{Model}}{factor; the car model.}
#' \item{\code{Type}}{factor; the exact model type.}
#' \item{\code{Fuel}}{factor; the type of fuel (\code{"Diesel"} or
#' \code{"Petrol"}).}
#' \item{\code{Price}}{numeric; the list price (in UK pounds)}
#' \item{\code{Cylinders}}{numeric; the number of cylinders in the engine.}
#' \item{\code{Displacement}}{numeric; the displacement of the engine (in
#' cc).}
#' \item{\code{DriveWheel}}{factor; the type of drive wheel (\code{"4WD"},
#' \code{"Front"} or \code{"Rear"}).}
#' \item{\code{BHP}}{numeric; the power of the engine (in bhp).}
#' \item{\code{Torque}}{numeric; the torque of the engine (in lb/ft).}
#' \item{\code{Acceleration}}{numeric; the time it takes the car to get from
#' 0 to 62 mph (in seconds).}
#' \item{\code{TopSpeed}}{numeric; the car's top speed (in mph).}
#' \item{\code{MPG}}{numeric; the combined fuel consuption (urban + extra
#' urban; in miles per gallon).}
#' \item{\code{Weight}}{numeric; the car's curb weight (in kg).}
#' \item{\code{Length}}{numeric; the car's length (in mm).}
#' \item{\code{Width}}{numeric; the car's width (in mm).}
#' \item{\code{Height}}{numeric; the car's height (in mm).}
#' \item{\code{AdaptiveHeadlights}}{factor; whether the car has adaptive
#' headlights (\code{"no"}, \code{"optional"} or \code{"standard"}).}
#' \item{\code{AdjustableSteering}}{factor; whether the car has adjustable
#' steering (\code{"no"} or \code{"standard"}).}
#' \item{\code{AlarmSystem}}{factor; whether the car has an alarm system
#' (\code{"no/optional"} or \code{"standard"}).}
#' \item{\code{Automatic}}{factor; whether the car has an automatic
#' transmission (\code{"no"}, \code{"optional"} or \code{"standard"}).}
#' \item{\code{Bluetooth}}{factor; whether the car has bluetooth
#' (\code{"no"}, \code{"optional"} or \code{"standard"}).}
#' \item{\code{ClimateControl}}{factor; whether the car has climate control
#' (\code{"no"}, \code{"optional"} or \code{"standard"}).}
#' \item{\code{CruiseControl}}{factor; whether the car has cruise control
#' (\code{"no"}, \code{"optional"} or \code{"standard"}).}
#' \item{\code{ElectricSeats}}{factor; whether the car has electric seats
#' (\code{"no"}, \code{"optional"} or \code{"standard"}).}
#' \item{\code{Leather}}{factor; whether the car has a leather interior
#' (\code{"no"}, \code{"optional"} or \code{"standard"}).}
#' \item{\code{ParkingSensors}}{factor; whether the car has parking sensors
#' (\code{"no"}, \code{"optional"} or \code{"standard"}).}
#' \item{\code{PowerSteering}}{factor; whether the car has power steering
#' (\code{"no"} or \code{"standard"}).}
#' \item{\code{SatNav}}{factor; whether the car has a satellite navigation
#' system (\code{"no"}, \code{"optional"} or \code{"standard"}).}
#' \item{\code{ESP}}{factor; whether the car has ESP (\code{"no"},
#' \code{"optional"} or \code{"standard"}).}
#' \item{\code{Verdict}}{numeric; review score between 1 (lowest) and 10
#' (highest).}
#' \item{\code{Origin}}{factor; the origin of the car maker (\code{"Asia"},
#' \code{"Europe"} or \code{"USA"}).}
#' }
#'
#' @source
#' The data were scraped from \code{http://www.topgear.com/uk/} on 2014-02-24.
#' Variable \code{Origin} was added based on the car maker information.
#'
#' @examples
#' data("TopGear")
#' summary(TopGear)

"TopGear"
63 changes: 63 additions & 0 deletions R/nci60.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# --------------------------------------
# Author: Andreas Alfons
# Erasmus Universiteit Rotterdam
# --------------------------------------

#' @name nci60
#' @aliases protein
#' @aliases gene
#'
#' @docType data
#'
#' @title NCI-60 cancer cell panel
#'
#' @description
#' The data set is a pre-processed version of the NCI-60 cancer cell panel as
#' used in Alfons, Croux & Gelper (2013). One observation was removed since
#' all values in the gene expression data were missing.
#'
#' @usage
#' data("nci60")
#'
#' @format
#' Protein and gene expression data on 59 observations are stored in two
#' separate matrices:
#' \describe{
#' \item{\code{protein}}{a matrix containing protein expressions based on
#' antibodies (162 variables), acquired via reverse-phase protein lysate
#' arrays and log2 transformed.}
#' \item{\code{gene}}{a matrix containing gene expression data (22283
#' variables), obtained with an Affymetrix HG-U133A chip and normalized
#' with the GCRMA method.}
#' }
#'
#' @source
#' The original data were downloaded from
#' \url{https://discover.nci.nih.gov/cellminer/} on 2012-01-27. They can be
#' obtained from \url{https://github.com/aalfons/nci60}, together with our
#' script for pre-processing.
#'
#' @references
#' Reinhold, W.C., Sunshine, M., Liu, H., Varma, S., Kohn, K.W., Morris, J.,
#' Doroshow, J. and Pommier, Y. (2012) CellMiner: A Web-Based Suite of Genomic
#' and Pharmacologic Tools to Explore Transcript and Drug Patterns in the
#' NCI-60 Cell Line Set. \emph{Cancer Research}, \bold{72}(14), 3499--3511.
#'
#' Alfons, A., Croux, C. and Gelper, S. (2013) Sparse least trimmed squares
#' regression for analyzing high-dimensional large data sets. \emph{The Annals
#' of Applied Statistics}, \bold{7}(1), 226--248.
#'
#' @examples
#' \dontrun{
#'
#' # load data
#' data("nci60")
#' # define response variable
#' y <- protein[, 92]
#' # screen most correlated predictor variables
#' correlations <- apply(gene, 2, corHuber, y)
#' keep <- partialOrder(abs(correlations), 100, decreasing = TRUE)
#' X <- gene[, keep]
#' }

NULL
31 changes: 31 additions & 0 deletions R/robustHD-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# --------------------------------------
# Author: Andreas Alfons
# Erasmus Universiteit Rotterdam
# --------------------------------------

#' @name robustHD-package
#'
#' @docType package
#'
#' @title \packageTitle{robustHD}
#'
#' @description \packageDescription{robustHD}
#'
#' @details
#' The DESCRIPTION file:
#' \packageDESCRIPTION{robustHD}
#' \packageIndices{robustHD}
#'
#' @references
#' Alfons (2021) \pkg{robustHD}: An \R package for robust regression with
#' high-dimensional data. \emph{Journal of Open Source Software}, \bold{6}(67),
#' 3786. \doi{10.21105/joss.03786}.
#'
#' @author
#' \packageAuthor{robustHD}
#'
#' Maintainer: \packageMaintainer{robustHD}
#'
#' @keywords package

NULL
129 changes: 66 additions & 63 deletions man/TopGear.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 27 additions & 26 deletions man/nci60.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a782428

Please sign in to comment.