Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. setwd("~/data/observation1")
  2.  
  3. library(ggplot2)
  4. ggplot(a, aes(x = place, y = firing_rate)) + geom_point() + geom_path()
  5.  
  6. files <- list.files(pattern=".txt")
  7. for (i in files){
  8. mylist <- lapply(setNames(files, files), read.table, header = T)
  9. mylist <- lapply(names(mylist), function(i) {cbind(mylist[[i]], ID = i)})
  10. mydata <- do.call(rbind, mylist)
  11. }
  12.  
  13. ggplot(mydata, aes(x = place, y = firing_rate, colour = ID)) + geom_point() + geom_path()
  14. dev.print(pdf, 'observation1.pdf')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement