# Load data
data(exampleSummary)
# See the format of the data
head(exampleSummary)
# Find the correlations between the numeric vectors in the summary for the two types of trees
# This can be very useful. Observe the differences in correlations
homCor <- cor(exampleSummary[1:50,1:6])
ssCor <- cor(exampleSummary[51:100,1:6])
randCor <- cor(exampleSummary[101:150,1:6])
### I WILL NOW ILLUSTRATE SOME USES OF THE PACKAGE
### THESE METHODS USE LIBARY ggplot2
### IT WILL NEED TO BE SEPERATELY INSTALLED IF YOU WISH TO USE IT
# Initialize plot
p <- ggplot(data=exampleSummary) + facet_wrap(~Type)
# A bar plot of nLadders with colors determined by maxLadder
p + geom_bar(aes(nLadders,fill=factor(maxLadder)),binwidth=1) +
guides(fill=guide_legend(title='maxLadder'))
# A scatter plot of maxLadder against avgLadder
p + geom_point(aes(maxLadder,avgLadder,color=Type)) + theme(legend.position='none')
Run the code above in your browser using DataLab