swap: Swaps two elements in a data frame. An internal function.

View source: R/randomization_procedures.R View source: R/null_models.R

swapR Documentation

Swaps two elements in a data frame. An internal function.

Description

NA

Usage

swap(df, r1, c1, r2, c2)

Arguments

df
r1
c1
r2
c2

Author(s)

Tim Gernat <mail@timgernat.name>

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (df, r1, c1, r2, c2) 
{
    tmp <- df[r1, c1]
    df[r1, c1] <- df[r2, c2]
    df[r2, c2] <- tmp
    return(df)
  }

bblonder/timeordered documentation built on Aug. 29, 2023, 9:15 a.m.