# NOT RUN {
x1 <- 1:4
z1 <- c(0,1,0,0)
z2 <- c(1,0,0,0)
z3 <- c(0,0,1,0)
xz <- cbind(x1,z1,z2,z3)
getPoly(xz,2)
# xdata component of output:
# V1 V2 V3 V4 V5 V9 V10 V11
# 1 1 0 1 0 1 0 1 0
# 2 2 1 0 0 4 2 0 0
# 3 3 0 0 1 9 0 0 3
# 4 4 0 0 0 16 0 0 0
# V1-V4 are copies of x1,z1,z2,z3, 1st-degree terms; V5 is x1^2; V9 is
# product x1 * z2; etc.; note that, V6-V8 were not retained
# }
Run the code above in your browser using DataLab