Subject | R Documentation |
contains subject meta information after preprocessing.
meta
environment stores subject meta data
subject_id
character, subject ID, generated from project name
and subject code. For example, project name is "congruency"
and
subject code is "YAB"
, then the subject_id="congruency/YAB"
subject_code
identifier for subject
project_name
project name
dirs
stores folder paths for subject data
is_strict
whether preprocess directory is checked when initializing the instance
electrodes
electrode table (read-only)
frequencies
frequency table (read-only)
time_points
time-point table (read-only)
time_excluded
(deprecated) excluded time-point table (read-only)
sample_rate
time-point table (read-only, for compatibility issues)
volt_sample_rate
voltage (trace) sampling rate in Hertz (read-only)
power_sample_rate
power (amplitude) sampling rate in Hertz (read-only)
phase_sample_rate
phase sampling rate in Hertz (read-only)
valid_electrodes
all valid electrodes in current reference scheme (read-only)
id
read-only version of subject ID
info()
print the information of the subject
Subject$info()
none
print()
override of default print method
Subject$print(...)
...
ignored
default memory address of the environment
finalize()
called when garbage collected
Subject$finalize()
new()
constructor
Subject$new(project_name, subject_code, reference = NULL, strict = TRUE)
project_name
project name
subject_code
subject code
reference
what kind of reference is default for the subject,
default is "default", referring to "reference_default.csv"
in
subject meta folder
strict
whether to check if the raw folder exists
preprocess_info()
Obtain preprocessing information. This methods is rarely directly called, I wrap up most commonly used fields in other functions
Subject$preprocess_info(key, default = NULL, customized = FALSE)
key
the fields or items store in SubjectInfo2
instance
default
default value if the key is not found
customized
indicates whether the key refers to additional items
or fields in SubjectInfo2
. Default is false, meaning
the key is the fields.
the preprocess information correspond to the key
filter_all_electrodes()
filter, and returns existing electrodes
Subject$filter_all_electrodes(electrodes)
electrodes
integer vector
the electrodes that the subject has, including bad, or invalid electrodes.
filter_valid_electrodes()
filter, and returns valid electrodes
Subject$filter_valid_electrodes(electrodes)
electrodes
integer vector
the valid electrodes. Invalid electrodes refers to bad
electrodes, or the end of bipolar reference. If "Reference"
column is blank in the reference file, then the electrode is invalid.
has_bad_time_point()
(deprecated) check whether the selected time is excluded
Subject$has_bad_time_point(block, electrode, start, end)
block
block name
electrode
electrode number
start
start time
end
end time
clone()
The objects of this class are cloneable with this method.
Subject$clone(deep = FALSE)
deep
Whether to make a deep clone.
Zhengjia Wang
## Not run:
# Load subject, use `strict=FALSE` if not sure the existence of raw files
subject <- Subject$new(project_name = 'demo', 'YAB', strict = FALSE)
# Filter 1:14 to see which numbers refer to the valid electrodes
subject$filter_valid_electrodes(1:14)
#> [1] 13 14
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.