constant.data.frame: Identify Constant Features of a Data Frame

View source: R/constant.R

constant.data.frameR Documentation

Identify Constant Features of a Data Frame

Description

Returns columns of a data.frame whose values do not vary within subsets defined by columns named in .... Defaults to groups(x) if none supplied, or all columns otherwise.

Usage

## S3 method for class 'data.frame'
constant(x, ...)

Arguments

x

object

...

optional grouping columns (named arguments are ignored)

Value

data.frame (should be same class as x)

See Also

Other constant: constant()

Examples

library(dplyr)
constant(Theoph)                      # data frame with 0 columns and 1 row
constant(Theoph, Subject)             # Subject Wt Dose Study
Theoph$Study <- 1
constant(Theoph)                      # Study
constant(Theoph, Study)               # Study
constant(Theoph, Study, Subject)      # Subject Wt Dose Study
Theoph <- group_by(Theoph, Subject)
constant(Theoph)                      # Subject Wt Dose Study
constant(Theoph, Study)               # Study

bergsmat/wrangle documentation built on Aug. 29, 2023, 11:28 a.m.