Guest User

Untitled

a guest
Apr 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. # install fnirsr
  2. devtools::install_github("erzk/fnirsr")
  3.  
  4. library(dplyr)
  5. library(fnirsr)
  6.  
  7. # file path
  8. p01_path <- "/media/.../p01_fnirs_data_MES_Probe1.csv" # MES file
  9.  
  10. # load the header
  11. header <- load_ETG4000_header(p01_path)
  12.  
  13. # load the file
  14. df <- load_ETG4000_data(p01_path, header)
  15.  
  16. # trim down to facilitate the demo
  17. df <- df[1:2500,]
  18.  
  19. # overview
  20. str(df)
  21.  
  22. # block borders
  23. all_borders <- which(df$Mark != 0)
  24.  
  25. # plot the signal
  26. plot(df$CH1.703.6., type = "l", ylab = "Intensity")
  27. abline(v = all_borders, col = "red")
  28.  
  29. # overview of Marks
  30. df %>% dplyr::filter(Mark != 0) %>% select(Mark) %>% table()
Add Comment
Please, Sign In to add comment