diff --git a/NAMESPACE b/NAMESPACE index 4626241..b1a27e7 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -98,6 +98,7 @@ importFrom(stats,glm.fit) importFrom(stats,lm) importFrom(stats,lm.fit) importFrom(stats,lm.wfit) +importFrom(stats,model.extract) importFrom(stats,model.frame) importFrom(stats,model.matrix) importFrom(stats,model.offset) @@ -112,6 +113,7 @@ importFrom(stats,terms) importFrom(stats,update) importFrom(stats,vcov) importFrom(stats,weighted.mean) +importFrom(stats,weights) importFrom(survival,survfit) importFrom(utils,head) importFrom(utils,tail) diff --git a/R/design.R b/R/design.R index e5351d0..5d03b27 100644 --- a/R/design.R +++ b/R/design.R @@ -92,6 +92,11 @@ offsets.design <- function(object, ...) { specials <- function(object, ...) UseMethod("specials") ##' @export +##' @title Extract model component from [design] object +##' @param object [design] object +##' @param which model component (e.g., "offset", "weights", ...) +##' @aliases specials specials.design offsets offsets.design weights.design +##' @param ... Additional arguments to lower level functions specials.design <- function(object, which, ...) { return(object[[which]]) } diff --git a/R/targeted-package.R b/R/targeted-package.R index d9b74fb..3db3140 100644 --- a/R/targeted-package.R +++ b/R/targeted-package.R @@ -15,7 +15,7 @@ ##' model.frame model.matrix na.pass nlminb predict ##' dnorm quantile terms weighted.mean runif ##' .getXlevels delete.response model.response gaussian formula -##' model.offset reformulate drop.terms +##' model.offset reformulate drop.terms weights model.extract ##' @importFrom digest sha1 ##' @importFrom optimx optimx ##' @importFrom data.table data.table is.data.table diff --git a/README.Rmd b/README.Rmd index 13bc4bb..555ad3d 100644 --- a/README.Rmd +++ b/README.Rmd @@ -13,7 +13,8 @@ knitr::opts_chunk$set( [![travis](https://travis-ci.com/kkholst/targeted.svg?branch=main)](https://travis-ci.com/kkholst/targeted) [![coverage](https://codecov.io/github/kkholst/targeted/coverage.svg?branch=main)](https://app.codecov.io/github/kkholst/targeted?branch=main) - [![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/license/apache-2-0) + [![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)]( + https://opensource.org/license/apache-2-0) [![cran](https://www.r-pkg.org/badges/version-last-release/targeted)](https://cranlogs.r-pkg.org/downloads/total/last-month/targeted) diff --git a/README.md b/README.md index e76ed2a..afb9892 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![R-CMD-check](https://github.com/kkholst/targeted/workflows/R-CMD-check/badge.svg?branch=master)](https://github.com/kkholst/targeted/actions) - [![coverage](https://app.codecov.io/github/kkholst/targeted/coverage.svg?branch=master)](https://app.codecov.io/github/kkholst/targeted?branch=master) + [![coverage](https://app.codecov.io/github/kkholst/targeted/coverage.svg?branch=main)](https://app.codecov.io/github/kkholst/targeted?branch=main) [![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/license/apache-2-0) [![cran](https://www.r-pkg.org/badges/version-last-release/targeted)](https://cranlogs.r-pkg.org/downloads/total/last-month/targeted) diff --git a/man/specials.design.Rd b/man/specials.design.Rd new file mode 100644 index 0000000..49b2fc6 --- /dev/null +++ b/man/specials.design.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/design.R +\name{specials.design} +\alias{specials.design} +\alias{specials} +\alias{offsets} +\alias{offsets.design} +\alias{weights.design} +\title{Extract model component from \link{design} object} +\usage{ +\method{specials}{design}(object, which, ...) +} +\arguments{ +\item{object}{\link{design} object} + +\item{which}{model component (e.g., "offset", "weights", ...)} + +\item{...}{Additional arguments to lower level functions} +} +\description{ +Extract model component from \link{design} object +}