Skip to contents

The function `bs` generates a matrix that resamples length with replacement. The original data set is stored in the first row, while the resamples are stored in the ith row Bi+1, where B is the total number of resamples.

Usage

bs(df, B, n, semilla)

Arguments

df

A data frame

B

An integer value indicating the number of of resamples

n

An integer value indicating the number of observations

semilla

An integer value is a seed to initialize a pseudorandom number generator.

Value

A matrix **mb** that includes both the original data set and the ith-generated resamples.

Examples

  if (FALSE) {
      df = tmp
      B <- 2000
      n <- 3000
      semilla <- 100
# Reproducing the same output every time
      ejemplo <- bs(df,B,n,semilla)

# Reproducing the different output every time
      semilla <- NULL
      ejemplo <- bs(df,B,n,semilla)
    }