as.emg: Coerce to an 'emg' object

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/as.emg.R

Description

Functions to check if an object is an ‘emg’ object, or coerce it if possible.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
as.emg(x, ...)
## Default S3 method:
as.emg(x, ...)
## S3 method for class 'numeric'
as.emg(x, ...)
## S3 method for class 'matrix'
as.emg(x, ...)
## S3 method for class 'data.frame'
as.emg(x, ...)
is.emg(x)

Arguments

x

any R object.

...

additional arguments to be passed to methods (such as the samplingrate or the units of the EMG signal).

Details

as.emg is a generic function with many methods to coerce an object to an ‘emg’ object.

is.emg checks if x is an ‘emg’ object.

Value

as.emg returns an ‘emg’ object.

is.emg returns TRUE if its argument is an ‘emg’ object (that is, has “emg” amongst its classes) and FALSE otherwise.

Author(s)

J.A. Guerrero jaguerrero@correo.uaa.mx

See Also

emg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Creates 1 sec. of a simulated EMG with only baseline noise
x <- rnorm(1000)
# Coerce a vector into an 'emg' object
emgx <- as.emg(x, sampligrate = 1000)
# Plot the data in emgx
plot(emgx, main = "Synthetic EMG noise")

# Load a data.frame with EMG data
data(emg96627009)
# Coerce a data.frame into an 'emg' object
x <- as.emg(emg96627009)
# Plot the data in x
plot(x, main = "EMG of limb muscles of decorticated cat")

Example output



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