split_data_prob {stressor}R Documentation

Create Train Index Set

Description

This function takes in a data.frame object and the training size and returns a logical vector indicating which entries to include.

Usage

split_data_prob(data, test_prop)

Arguments

data

A data.frame object used to determine the length of the vector.

test_prop

A numeric that is between zero and one that represents the proportion of observations to be included in the test data.

Value

A logical vector is returned that is the same length as the number of rows of the data.

Examples

  lm_data <- data_gen_lm(10)
  indices <- split_data_prob(lm_data, .8)
  train <- lm_data[indices, ]
  test <- lm_data[!indices, ]

[Package stressor version 0.2.0 Index]