[R] persp plot increasing 'x' and 'y' values expected
murdoch at stats.uwo.ca
Tue Apr 25 12:51:34 CEST 2006
On 4/25/2006 6:23 AM, Michael Dondrup wrote:
> of course it can't because the number of unique values is different. You need
> a unique _combination_ of x,y and hopefully you don't have different z values
> for any such a pair. try:
> xyz <- unique(cbind(x,y,z))
> If you still get the err, then you had different measurements for the same
I think you and Andreas want scatterplot3d (from a contributed package
of the same name), not persp. Persp takes very data in a very
particular format. See the man page.
In general, it's a good idea to test your suggestions before posting
them. Yours wouldn't work, because x, y and z *must not* be the same
length in persp.
> Am Tuesday 25 April 2006 12:24 schrieb voodooochild at gmx.de:
>> hi peter,
>> thank you for your advice.
>> ok, i see the problem, but if i do
>> it also doesn't work.
>> i want to do a plot, where i can see, how x and y influences z.
>> P Ehlers wrote:
>>> voodooochild at gmx.de wrote:
>>>> i do the following in order to get an persp-plot
>>>> persp(x,y,z, col="gray")
>>>> but i always get the error message increasing 'x' and 'y' values
>>>> expected, but i think my data values are already increasing, what is
>>> I'm not sure what your data$x, data$y, data$z are (but I can guess).
>>> Why do you think that your x is *increasing*? Is x[i+1] > x[i]?
>>> Does diff(x) yield only positive values?
>>> What kind of a perspective plot do you expect? You seem to have only
>>> 5 unique points.
>>> Peter Ehlers
>>>> best regards
>> R-help at stat.math.ethz.ch mailing list
>> PLEASE do read the posting guide!
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
More information about the R-help