sample_info: Extract information of the sample contained in a data set

View source: R/make-newdata.R

sample_infoR Documentation

Extract information of the sample contained in a data set

Description

Given a data set and grouping variables, this function returns mean values for numeric variables and modus for characters and factors. Usually this function should not be called directly but will rather be called as part of a call to make_newdata.

Usage

sample_info(x)

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

## S3 method for class 'ped'
sample_info(x)

## S3 method for class 'fped'
sample_info(x)

Arguments

x

A data frame (or object that inherits from data.frame).

Value

A data frame containing sample information (for each group). If applied to an object of class ped, the sample means of the original data is returned. Note: When applied to a ped object, that doesn't contain covariates (only interval information), returns data frame with 0 columns.


pammtools documentation built on July 26, 2023, 6:07 p.m.