sample_df: Randomly draws observations from a data set

View source: R/data_tools.R

sample_dfR Documentation

Randomly draws observations from a data set

Description

This function is useful to check a data set. It gives a random number of rows of the input data set.

Usage

sample_df(x, n = 10, previous = FALSE)

Arguments

x

A data set: either a vector, a matrix or a data frame.

n

The number of random rows/elements to sample randomly.

previous

Logical scalar. Whether the results of the previous draw should be returned.

Value

A data base (resp vector) with n rows (resp elements).

Author(s)

Laurent Berge

Examples


sample_df(iris)

sample_df(iris, previous = TRUE)


fixest documentation built on June 22, 2024, 9:12 a.m.