Skip to content

Instantly share code, notes, and snippets.

@vmirly
Last active December 25, 2015 02:29
Show Gist options
  • Select an option

  • Save vmirly/6902687 to your computer and use it in GitHub Desktop.

Select an option

Save vmirly/6902687 to your computer and use it in GitHub Desktop.
R read files from a directory and plot them
# this R code, will read all the result files found in the specified directory,
# and plot the membrane thickness as a function of time
f.list <- list.files("run_05_rad8t6_den0.2/", pattern="res.tknss.*", full.names=T)
d.list <- lapply(f.list, read.table)
d <- do.call(rbind, d.list)
d$V1=as.numeric(rownames(d))/500
plot(d, col="blue", type="l", lwd=2, xlab="Time (ns)", ylab="Thickness")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment