[R] Odp: question on image() function?

Petr PIKAL petr.pikal at precheza.cz
Thu Nov 8 18:31:18 CET 2007


Hi

look at akima package, especially its function interp.

Petr

petr.pikal at precheza.cz

r-help-bounces at r-project.org napsal dne 08.11.2007 17:51:21:

> Dear friends,
>   My dataset is like the following:
>          x                y              mcpvalue
> 0.4603578     0.6247629       1.001
> 0.4603715     0.6247788        1.001
> 0.4603852     0.6247948       1.001
> 0.4110561     0.5664841       0.995
>  The x and y variables are unsorted.
>  I use the function image(x,y,mcpvalue) to generate a plot, but the 
error
> is that "increasing 'x' and 'y' values are expected". So i use
>    image(x=seq(min(x),max(x)), y=seq(min(y),max(y)),z=as.matrix
> (result$mcpvalue))
> to do it again, but there is still an error "dimensions of z are not
> length(x)(-1) times length(y)(-1)".
>   Anybody can show me how to use the image() correctly with the original 
x/y
> unsorted?
>   Thanks very much.
> 
> 
> -- 
> With Kind Regards,
> 
> oooO:::::::::
> (..):::::::::
> :\.(:::Oooo::
> ::\_)::(..)::
> :::::::)./:::
> ::::::(_/::::
> :::::::::::::
> 
[***********************************************************************]
> Zhi Jie,Zhang ,PHD
> Tel:+86-21-54237149
> Dept. of Epidemiology,School of Public Health,Fudan University
> Address:No. 138 Yi Xue Yuan Road,Shanghai,China
> Postcode:200032
> Email:epistat at gmail.com
> Website: www.statABC.com
> 
[***********************************************************************]
> oooO:::::::::
> (..):::::::::
> :\.(:::Oooo::
> ::\_)::(..)::
> :::::::)./:::
> ::::::(_/::::
> :::::::::::::
> 
>    [[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