Defines functions as.mitml.list

Documented in as.mitml.list

as.mitml.list <- function(x){
# adds a class attribute "mitml.list" to its argument

  if(!is.list(x)) stop("Argument must be a 'list'.")

  if(any(!sapply(x, is.data.frame))){
    x <- lapply(x, as.data.frame)
    cat("Note: List entries were converted to class 'data.frame'.\n")

  class(x) <- c("mitml.list", class(x))

Try the mitml package in your browser

Any scripts or data that you put into this service are public.

mitml documentation built on March 31, 2023, 7:01 p.m.