Skip to content

Instantly share code, notes, and snippets.

@kohnakagawa
Created August 3, 2014 11:35
Show Gist options
  • Save kohnakagawa/b4a4e841d792381ea2f0 to your computer and use it in GitHub Desktop.
Save kohnakagawa/b4a4e841d792381ea2f0 to your computer and use it in GitHub Desktop.
options(scipen=2)
btime <- 1240000
etime <- 3960000
stptime <- 40000
time <- seq(btime,etime,by=stptime)
sepval <- 32.0
tardir <- "./cutof0.65/chem5e-5inv0.65h0.20o0.052"
for(i in time){
#infile <- paste(tardir,"/z_cord_hyphil_time",i,".txt",sep="")
infile <- paste(tardir,"/z_cord_hyphob_time",i,".txt",sep="")
#outfile <- paste(tardir,"/in_memb_elem.txt",sep="")
outfile <- paste(tardir,"/bud_hyphob_elem.txt",sep="")
dat <- read.table(infile)
dat <- data.matrix(dat)
inelem <- sum(dat[,3] > sepval)
outelem <- length(dat[,3]) - inelem
wrtdat <- c(inelem,outelem,length(dat[,3]))
write(t(wrtdat),outfile,append=T,ncolumns=3)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment