R/as.emg.data.frame.R

Defines functions as.emg.data.frame

Documented in as.emg.data.frame

as.emg.data.frame <- function(x, ...) {
    args <- list(...)
    namesargs <- names(args)
    if ("samplingrate" %in% namesargs) 
        samplingrate <- args$samplingrate else samplingrate <- 0
    if ("units" %in% namesargs) 
        units <- args$units else units <- ""
    data <- as.matrix(x)
    if (dim(data)[2] > 1) {
        dimnames(data) <- NULL
    } else {
        attributes(data) <- NULL
    }
    object <- emg(data, samplingrate = samplingrate, units = units, data.name = colnames(x))
    return(object)
}

Try the biosignalEMG package in your browser

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

biosignalEMG documentation built on May 2, 2019, 12:07 p.m.