edf.batch | R Documentation |
edf.batch
is useful for processing a bunch of EDF files at once and saving the resulting data
edf.batch(EDFfiles = NULL, pattern = NULL, samples = FALSE, do.plot = TRUE, save.plot = FALSE, save.files = NA, outdir = NULL, plot.theme = "black", plot.res = NULL)
EDFfiles |
a character vector of EDF files OR a directory where EDF files can be found |
pattern |
a regular expression for matching file names of EDFs (e.g., '*.edf'). Only needed if a directory is specified instead of a list of files. |
samples |
a logical specifying whether samples should be included (default=FALSE) |
do.plot |
a logical indicating whether to produce a plot for each EDF (uses |
save.plot |
a logical indicating whether a PDF of the plot should be saved (must specify |
save.files |
format for saving output files, either 'R' or 'matlab' (requires package |
outdir |
a string specifying an output directory where to save the files. Required if |
plot.theme |
either "black" or "white" specifying the style of plot used in |
plot.res |
an array specifying the screen resoluion (e.g., c(1024, 768), used for |
This function takes either a list of EDF file names, or a directory and search pattern for files, then imports each one and (optionally) saves te data (either as .RData or .mat for matlab)
a list of all trial data that was imported. WARNING: if you import samples and try to save this as 1
file it will be extremely large. It is better to use save.files='R'
instead. All data will include a
column ID
that correponds to only the numeric parts of the EDF file name. This is useful for concatenating all the data together
Jason Hubbard, hubbard3@uoregon.edu
## Not run: #import a list of named EDF files, don't save anything #ID variable will be 1 for the first file, and 2 for the second alldata <- edf.batch(c('/path/to/EDF1.edf',/path/to/EDF2.edf'),samples=F,do.plot=T,plot.theme='white',plot.res=c(1024,768) #import all EDFs from basedir, and save all the output for R basedir <- '~/Desktop/edfs' alldata <- edf.batch(basedir,pattern='*.edf',samples=T,do.plot=T,save.plot=T,save.files='R',outdir='~/Desktop/output',plot.res=c(1024,768)) #save for matlab, if you prefer (requires the package R.matlab): alldata <- edf.batch(basedir,pattern='*.edf',samples=T,do.plot=T,save.plot=T,save.files='matlab',outdir='~/Desktop/output',plot.res=c(1024,768)) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.