interact.part: Compute a chosen set of pairwise interactions between two...

Description Usage Arguments Value Examples

View source: R/int.R

Description

Similar to interact.all-function, but here user provides two sets of variables, and each pairwise combination between these two sets is multiplied. These pairwise interactions are then returned as a new data matrix, with a colon indicating which variables were multiplied.

Usage

1
interact.part(input, first, second)

Arguments

input

The input data matrix, of either class matrix or data.frame

first

The first set of columns to combine with each of the members of the second set, as either integers or column names

second

The second set of columns to combine with each of the members of the first set, as either integers or column names

Value

A data matrix with multiplied columns as indicated using the sets 'first' and 'second'

Examples

1
2
3
4
5
set.seed(1)
somedata <- data.frame(a = rnorm(10), b = rnorm(10), c = runif(10), d = runif(10))
somedata
someinteract <- interact.part(somedata, first = c("a", "b"), second = c("c", "d"))
someinteract

ePCR documentation built on Dec. 1, 2019, 1:21 a.m.

Related to interact.part in ePCR...