[R] contour

Rui Barradas ruipbarradas at sapo.pt
Wed Jul 18 12:16:57 CEST 2012


Hello,

Follow the code below and see what's the right way:


d <- read.table(text="
x1 x2 x3
0   1    2
0   2    1
0   3    5
1   1    4
1   2    2
1   3    3
", header=TRUE)

x3 <- matrix(d[, "x3"], ncol=2)
levels <- sort(unique(x3))
contour(0:1, 1:3, t(x3), levels=levels)


Hope this helps,

Rui Barradas

Em 18-07-2012 10:23, Akhil dua escreveu:
> Hello Everyone
>
> I have the data long format and I want to draw the contour plot with it
>
> x1 x2 x3
> 0   1    2
> 0   2    1
> 0   3    5
> 1   1    4
> 1   2    2
> 1   3    3
>
>
> when I am using contour(x1,x2,x3,col=heat.colors) or fill.contour
> its giving me an error that increasing x and y expected
>
>
> So please tell me what is the right function to draw contour when the data
> is not ordered and you cant order it.
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list