Given the data frame dset
and a data frame rx
with the same number of rows,
add monomials of degree 2 to dset for all quadratic combinations of the first PRE.npc
columns of rx
. The naming of these new columns is "R1x2" for the combination of cols
1 and 2 and so on (if prefix="R").
tdmPreAddMonomials(dset, rx, PRE.npc, opts, degree = 2, prefix = "R")
the target data frame
a data frame where to draw the monomials from
the number of columns from rx
to use (clipped to ncol(rx)
if necessary)
a list from which we need here the following entries:
filename
VERBOSE
[2] (currently only 2 is supported)
["R"] character prefix for the monomial column names
data frame dset
with the new monomial columns appended. If
PRE.npc==0, the data frame is returned unchanged.