Skip to content

Instantly share code, notes, and snippets.

@erzk
Last active April 12, 2018 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erzk/b19ba983d3b4d87322d28a937f1af854 to your computer and use it in GitHub Desktop.
Save erzk/b19ba983d3b4d87322d28a937f1af854 to your computer and use it in GitHub Desktop.
# install fnirsr
devtools::install_github("erzk/fnirsr")
library(dplyr)
library(fnirsr)
# file path
p01_path <- "/media/.../p01_fnirs_data_MES_Probe1.csv" # MES file
# load the header
header <- load_ETG4000_header(p01_path)
# load the file
df <- load_ETG4000_data(p01_path, header)
# trim down to facilitate the demo
df <- df[1:2500,]
# overview
str(df)
# block borders
all_borders <- which(df$Mark != 0)
# plot the signal
plot(df$CH1.703.6., type = "l", ylab = "Intensity")
abline(v = all_borders, col = "red")
# overview of Marks
df %>% dplyr::filter(Mark != 0) %>% select(Mark) %>% table()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment