Learn R Programming

simFrame (version 0.5.0)

tail-methods: Methods for returning the last parts of an object

Description

Return the last parts of an object.

Usage

## S3 method for class 'SampleSetup':
tail(x, k = 6, n = 6, \dots)

## S3 method for class 'SimControl': tail(x)

## S3 method for class 'SimResults': tail(x, \dots)

## S3 method for class 'Strata': tail(x, \dots)

## S3 method for class 'VirtualContControl': tail(x)

## S3 method for class 'VirtualDataControl': tail(x)

## S3 method for class 'VirtualNAControl': tail(x)

## S3 method for class 'VirtualSampleControl': tail(x)

Arguments

x
an object.
k
for objects of class "SampleSetup", the number of set up samples to be kept in the resulting object.
n
for objects of class "SampleSetup", the number of indices to be kept in each of the set up samples in the resulting object.
...
additional arguments to be passed down to methods.

Value

  • An object of the same class as x, but in general smaller. See the Methods section below for details.

References

Alfons, A., Templ, M. and Filzmoser, P. (2010) An Object-Oriented Framework for Statistical Simulation: The RPackage simFrame. Journal of Statistical Software, 37(3), 1--36. URL http://www.jstatsoft.org/v37/i03/.

See Also

tail, "SampleSetup", "SimResults", "Strata"

Examples

Run this code
## load data
data(eusilcP)

## class "SampleSetup"
# set up samples using group sampling
set <- setup(eusilcP, grouping = "hid", size = 1000, k = 50)
summary(set)
# get the last 10 indices of each of the last 5 samples
tail(set, k = 5, n = 10)

## class "Strata"
# set up samples using group sampling
strata <- stratify(eusilcP, "region")
summary(strata)
# get strata information for the last 10 observations
tail(strata, 10)

Run the code above in your browser using DataLab