create_subset: Create a subset of a dataset

Description Usage Arguments Value Note See Also Examples

View source: R/sampling.R

Description

Create a subset of a dataset

Usage

1
create_subset(mdata, rows, cols = NULL)

Arguments

mdata

A mldr dataset

rows

A vector with the instances indexes (names or indexes).

cols

A vector with the attributes indexes (names or indexes).

Value

A new mldr subset

Note

It is not necessary specify the labels attributes because they are included by default.

See Also

Other sampling: create_holdout_partition(), create_kfold_partition(), create_random_subset()

Examples

1
2
3
4
5
## Create a dataset with the 20 first examples and the 7 first attributes
small.toy <- create_subset(toyml, seq(20), seq(7))

## Create a random dataset with 50 examples and 5 attributes
random.toy <- create_subset(toyml, sample(100, 50), sample(10, 5))

Example output

Loading required package: mldr
Loading required package: parallel
Loading required package: ROCR
Loading required package: gplots

Attaching package: 'gplots'

The following object is masked from 'package:stats':

    lowess

utiml documentation built on May 31, 2021, 9:09 a.m.