TABLE OF CONTENTS
methodsUni/unirec.data.frame [ Functions ]
NAME
unirec.data.frame --- method for data frames
FUNCTION
Method for data frames in in the required format, see bivrec.agdata for detail. It works by adding extra columns to the input and passing it into the bivariate functions.
SYNOPSIS
49 {
INPUTS
x a data frame
OUTPUTS
an object of class unirec
SOURCE
52 call <- match.call() 53 if(dim(x)[2] > 7 && all(colnames(x)[1:7] == c("i", "j", "k", "r", "start", 54 "stop", "delta"))) { 55 x <- x[order(x$i, x$j, x$k), ] 56 varnames <- colnames(x)[ - (1:7)] 57 # Add some extra empty columns, so it can be passsed to bivrec.agdata 58 x <- cbind(x[, 1:7], 0, x[, -(1:7)]) 59 colnames(x)[ - (1:7)] <- c("Delta", varnames) 60 out <- bivrec.agdata(x, fixzero = c("clust2", "subj2", "cov"), ...) 61 out$call <- call 62 return(out) 63 } else { 64 stop("input data frame needs to have colnames i, j, k, r, start, stop, delta") 65 } 66 }