[R] sort data.frame and contour()

Thomas Lumley tlumley at u.washington.edu
Thu Oct 4 20:02:17 CEST 2001


On Thu, 4 Oct 2001, Tord Snall wrote:
>
> Further, I would like to plot other data,
>
> pop.size<- c(800, 800, 1500, 1000, 158, 300, 740, 250, 2000, 1500, 250, 700)
> fem.frek<- c(0.054, 0.099, 0.04, 0.113, 0.234, 0.241, 0.099, 0.182, 0.176,
> 0.175, 0.126, 0.09)
> rel.femfec<- c(0.975, 0.713, 1.035, 1.745, 0.77, 1.162, 0.94, 0.636, 2.12,
> 2.159, 0.428, 1.217)
> emil.data<- as.data.frame(cbind(pop.size, fem.frek,asfem.frek,rel.femfec))
> attach(emil.data)
> contour(pop.size, fem.frek, matrix(rel.femfec, ncol=length(fem.frek)))
>
> using contour() but I get an error message and read
>
>    x,y: locations of grid lines at which the values in `z' are
>           measured.  These must be in ascending order.  By default,
>
> Must a model be fitted first and the model then plotted, or am I missing
> something essential?

Yes, you have to use an interpolator of some sort first.  I had some
recollection of this being documented but I can't find it anywhere.

	-thomas



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list