when writing the function, using the package example: FD_Beta(do.call(cbind, fskt), dij_fskt, max(dij_fskt), 2, "C") this is an RStudio answer Error in if (class(dij) == "matrix") { : the condition has length > 1