Learn R Programming

NetworkToolbox (version 1.1.2)

splitsamp: Split sample

Description

Randomly splits sample into equally divded sub-samples

Usage

splitsamp(data, samples = 10, splits = 2)

Arguments

data

Must be a dataset

samples

Number of samples to produce (Defaults to 10)

splits

Number to divide the sample by (Defaults to 2; i.e., split-half)

Value

A list containing the training (trainSample) and testing (testSample) sizes (training sample is made to have slightly larger sizes in the case of uneven splits), and their respective sample sizes (trainSize and testSize)

Examples

Run this code
# NOT RUN {
splithalf<-splitsamp(neoOpen)
# }

Run the code above in your browser using DataLab