Learn R Programming

smallstuff (version 1.0.3)

dataSet: Obtain a Dataset from a Formula

Description

Given a formula, a dataset and a subset, retrieve the dataset that fulfills the formula and subset.

Usage

dataSet(formula, data, subset = NULL)

Value

The dataset in data as a data table with variables as specified in formula and rows as specified by subset.

Arguments

formula

A formula

data

A dataset

subset

Either a logical vector or a vector of indices of the rows to be returned. If NULL (default), all rows are returned.

Examples

Run this code
dataSet(mpg~.-disp,mtcars,10:20)

Run the code above in your browser using DataLab