subsample: Subsample a data frame object

Description Usage Arguments Value Examples

View source: R/subsample.R

Description

A simple function that selects every "n" rows in a data frame to create a new data frame object. Effectively "thins" large datasets.

Usage

1
subsample(df, n = 5, random_start = FALSE, plot = TRUE)

Arguments

df

data frame. The data to process.

n

numeric. This will prompt the function to extract every "n" rows.

random_start

logical. Defaults to FALSE. If TRUE, randomises the start row of the data.

plot

logical. Defaults to TRUE. Plots the data automatically.

Value

A data frame object.

Examples

1
2
3
4
5
# Subsample every 10 rows:
subsample(squid.rd, n = 10)

# Subsample with random first value:
subsample(sardine.rd, 3, TRUE)

januarharianto/respR documentation built on Nov. 13, 2018, 1:21 p.m.