resample_partition: Generate an exclusive partitioning of a data frame

Description Usage Arguments Examples

View source: R/partition.R

Description

Generate an exclusive partitioning of a data frame

Usage

1

Arguments

data

A data frame

p

A named numeric vector giving where the value is the probability that an observation will be assigned to that group.

Examples

1
2
3
4
ex <- resample_partition(mtcars, c(test = 0.3, train = 0.7))
mod <- lm(mpg ~ wt, data = ex$train)
rmse(mod, ex$test)
rmse(mod, ex$train)

modelr documentation built on May 29, 2017, 11:36 a.m.

Search within the modelr package
Search all R packages, documentation and source code