biosignalEMG (version 2.0.0)

emg: EMG object

Description

Creates an ‘emg’ object to store an EMG signal.

Usage

emg(data, samplingrate = 0, units = "", data.name = "") "plot"(x, channels = "all", samples = 0, type = "l", timeunits = c("samples", "seconds"), add = FALSE, ...) "print"(x, ...) "summary"(object, ...)

Arguments

data
a vector or a matrix (one column per channel) containing the observed data.
samplingrate
number of samples carried per second, measured in Hertz. A value of 0 indicates that this value is missing or unknown.
units
a character vector specifying the units (usually ‘mV’) of the EMG data.
data.name
a string specifying the name of the variable which will appears on the plots. If empty or not provided is taken from the object given as data.
x, object
an object of class ‘emg’.
type
what type of plot should be drawn. See plot for details.
channels
channels to be considered by the procedure. Possible values: "all" to consider all channels in data, a (vector of) character vector(s) specifying the names(s) of the channel(s) to be considered (case sensitive) or a numeric vector specifying the channels to be considered (number(s) of column(s) in data).
samples
samples to be plotted. Possible values: 0 (all samples), an integer ‘n’ (to plot the first ‘n’ samples) and a vectors of 2 integers ‘n1’ and ‘n2’ (to plot samples from ‘n1’ to ‘n2’).
timeunits
a character vector specifying the units (samples or seconds) for the time axis.
add
logical; if TRUE add to an already existing plot; if FALSE start a new plot.
...
additional arguments to be passed to the generic function.

Value

returns an object of class ‘emg’ which is a list with components:
values
a copy of data
units
the units argument
samplingrate
the samplingrate argument
data.name
the data.name argument

References

Konrad P. (2005) The ABC of EMG: A Practical Introduction to Kinesiological Electromyography. Version 1.0, Noraxon INC. USA.

Winter D.A., Rau G., Kadefors R., Broman H., Deluca C.J. (1980) Units, Terms, and Sandards in the Reporting of EMG Research: A Report by the AdHoc Committee of the International Society of Electrophysiology and Kinesiology.

See Also

iemg, eaemg

Examples

Run this code
# Creates a random vector to simulate an EMG signal
x <- rnorm(10000, 0, 1)
# Creates an 'emg' object to store x 
emg1 <- emg(x, samplingrate=1000, units="mV", data.name="")

# Summarize and visualize the data 
summary(emg1)
plot(emg1, main="Simulated EMG")

Run the code above in your browser using DataCamp Workspace