TABLE OF CONTENTS


methodsBiv/bivrec.data.frame [ Functions ]

NAME

    bivrec.data.frame --- method for data frames 

FUNCTION

Method for data frames in in the required format, see bivrec.agdata for detail This should only be called when used with the accompanying simulation routines.

SYNOPSIS

56 bivrec.data.frame <- function(x, ...)

INPUTS

    x      a data frame

OUTPUTS

           an object of class bivrec

SOURCE

59 {
60     call <- match.call()
61     # check that dimensions and column names are correct
62     if(dim(x)[2] > 8 && all(colnames(x)[1:8] == c("i", "j", "k", "r",
63                 "start", "stop", "delta", "Delta"))) {
64         x <- x[order(x$i, x$j, x$k), ]
65         out <- bivrec.agdata(x, ...)
66         out$call <- call
67         return(out)
68     } else {
69         if(dim(x)[2] == 8) stop("at least one covariate is required")
70         else stop(paste("input data frame needs to have colnames i, j, k, r",
71                     "start, stop, delta, Delta"))
72     }
73 }