# Read in the settings; Must change the RunName so that the example files can be found
filename=system.file("Examples/example_g_pars",package="Rsampletrees")
runpars=readArgs(filename, check=FALSE)
runname=paste(system.file(package="Rsampletrees"),runpars$RunName, sep="/")
runpars=changeArgs(runpars, RunName=runname)
# 1. Read in all the trees; may be slow
results=readOutput(runpars)
results=addTrees(results)
length(results$rawdata$Trees)
# 2. Read in a selection of lines
results=readOutput(runpars)
results=addTrees(results, all=FALSE, lines=c(5,10,62,63,90))
length(results$rawdata$Trees)
# 3. Read in trees from lines 5 to 15
results=readOutput(runpars)
results=addTrees(results, all=FALSE, start=5, end=15)
length(results$rawdata$Trees)
# 4. Read in 20 trees, starting at line 10
results=readOutput(runpars)
results=addTrees(results, all=FALSE, start=10, nlines=20)
length(results$rawdata$Trees)
Run the code above in your browser using DataLab