hello, all.

one of my students is having an issue with the pie & legend function.

this is her code.  (below)

it works just fine for me.

her error is "plot.new has not been called yet".  i know this means her pie 
chart is coming up blank so the legend will not work.

according to ?graphics  this package *is* supposed to handle these 
functionalities.  however, when i tried to install it i get the following error:

Warning message:
package ‘graphics’ is not available (for R version 2.15.2) 

however, the ?graphics page shows it is indeed available for this version of R.


Package:       graphics
Version:       2.15.2
Priority:      base
Title:         The R Graphics Package
Author:        R Core Team and contributors worldwide
Maintainer:    R Core Team <r-c...@r-project.org>
Description:   R functions for base graphics
Imports:       grDevices
License:       Part of R 2.15.2
Built:         R 2.15.2; ; 2012-10-26 16:14:39 UTC; unix

thoughts are greatly appreciated.



> strength <- factor(c(rep("8.0-9.9", 2), rep("7.0-7.9", 12), rep("6.0-6.9", 
> 108)))
> plot(strength, xlab="Earthquake Strength", ylab="Frequency")
> histogram(strength, xlab="Earthquake Strength", ylab="Relative Frequency by 
> Percentage")
> pie(table(strength))
legend("topright", title="Earthquake Strength", cex=0.6, pch=16, col=c("white", 
"blue", "red"), legend=c("6.0 to 6.9", "7.0 to 7.9", "8.0 to 8.9"), ncol=3)


~Nicole Ford
Ph.D. student
Graduate Assistant/ Instructor
University of South Florida
Government and International Affairs
office: SOC 012M
e: nmhi...@mail.usf.edu
http://gia.usf.edu/student/nford/







        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to