View source: R/null_models.R View source: R/randomization_procedures.R
swap | R Documentation |
NA
swap(df, r1, c1, r2, c2)
df |
A dataframe |
r1 |
The first row to swap |
c1 |
The first column to swap |
r2 |
The second row to swap |
c2 |
The second column to swap |
Tim Gernat <mail@timgernat.name>
##---- 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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.