readSensorLocs | R Documentation |
Read sensor locations from an external file or select locations from a data frame.
readSensorLocs(
source = "EEGlocations",
type = c("besa", "elp", "eeglab", "xyz", "custom"),
format = "",
select = "all",
plot = FALSE
)
getLocationsfromLabels(labels, plot = FALSE)
source |
Character string. The source file or data frame containing the
sensor location coordinates. |
type |
Character string, only used if
|
format |
Character string. Format of data to read when using a
For example: |
select |
Numeric or character vector, only used if |
plot |
logical, default: FALSE. If |
labels |
Character vector indicating the labels of the sensors to be selected |
The function readSensorLocs
reads sensor coordinates from a variety of
input sources. Some well-known file types are supported, such as BESA
spherical coordinates, and EEGLAB and Polhemus Cartesian coordinates. These
coordinate systems are converted by this function to the coordinate system
used by eegr
(see sensorlocs
).
Alternatively, a data.frame
may be specified as the source. This may
be useful if standard sensor locations are used, of which a particular
experiment uses a selection (see the select
parameter).
In addition, sensor locations may be read from an external file with a custom
format. In this case (type = 'custom'
), the function expects a format
string that specifies the coordinates (see the format
argument).
A data frame of class sensorlocs
containing x, y, z,
x2d, y2d, theta, phi in the eegr internal format. Other variables in the
input data frame or matrix are copied unchanged to the outpuut data frame.
Geert van Boxtel, G.J.M.vanBoxtel@gmail.com.
## Not run:
readSensorLocs ('/path/to/filename', type = 'besa', plot = TRUE)
readSensorLocs ('/path/to/filename', type = 'xyz', plot = c('Fz', 'Cz', 'Pz'))
readSensorLocs (source = '/somestrangeformat.txt', type = 'custom',
format='vars = (theta, phi, dummy), adjust=(*90/72, NULL, NULL), skip = (2)')
## End(Not run)
locs <- getLocationsfromLabels(c('Fz', 'Cz', 'Pz'), plot = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.