R- Graphing continuous data as a barplot with nonequal subsets -


i looking display dataset barplot in order show domains of data have more range variation others. although have found ways set barplot data domain broken down number of equal subsets, have not been able find way dictate numerical cutoffs of these subsets. cut() function has been giving me trouble, may because relatively new r.

the scatterplot representation of dataset working is: zooplankton.data. able display average species diversity score each discrete ph score, such average score ph <4, ph <= 4 | ph < 5, etc. each own bar.

the way have been trying solve using:

ph.bins<-cut(zoo$ph, c(3,4,5,6,7,8))  bar.ph <- tapply(zoo$species.diversity, list(zoo$ph.bins), mean)  barplot(bar.ph,      main="average species diversity score ph",      xlab = "ph",     ylab = "average species diversity",     col = "blue",     ylim = c(3,8)) par(new=f) 

unfortunately, keep getting error telling my tapply() arguments need same length, , not sure how proceed. suggestions?


Comments

Popular posts from this blog

php - Autoloader issue not returning Class -

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

java - How to put two numbers separated by a space into two different arrays -