#this is a function used to compile all the individual gt file generated by simphy in to on big file
#called by simphy.simu function
clean.simphy.folder<-function(repfolder,remove.individual.gtreefiles){
gfiles<-dir(path = repfolder,pattern = "g_trees\\d+.trees")
glist<-as.integer(sub("g_trees(\\d+).trees","\\1",gfiles))
gfiles<-gfiles[order(glist)]
gtrees<-c()
for(gfile in gfiles){
x<-scan(file = paste(repfolder,gfile,sep='/'),what='character',n=1,sep='\n',quiet=T)
gtrees<-c(gtrees,x)
}
new.g.file=paste(repfolder,'g_trees.trees',sep='/')
sink(new.g.file)
cat(paste(gtrees,sep='',collapse = '\n'))
sink()
if(remove.individual.gtreefiles){
for(gfile in gfiles){
unlink(x = paste(repfolder,gfile,sep='/'))
}
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.