Learn R Programming

GuessCompx (version 1.0.3)

rhead: Random Head

Description

Small Random Sample from a vector or data.frame

Usage

rhead(data, rows = 7, is.random = TRUE)

Arguments

data

A vector or data.frame from which a small sample is to be returned

rows

A positive integer, representing the number of lines or elements to print, default is 7.

is.random

a boolean. If TRUE, a random sample is drawn, else it takes the head() of the data

Value

A random sample without replacement taken from the data, in the same format than the input.

Details

If the rows parameter is greater than the actual number of rows/elements of the data, the returned value is the initial dataset after shuffling

Examples

Run this code
# NOT RUN {
set.seed(1234)
rhead(mtcars)
# }

Run the code above in your browser using DataLab