[R] Error Help only 0's may be mixed with negative subscripts

2014-01-31 Thread Agapitus Kato
Help Please. Iam drawing a plot i R_Studio but consistently get this error:
Error in colorlut2[((zlim[2] - z_invDist)/zlen) * 7] : only 0's may be
mixed with negative subscripts--

*Whenever you are confronted with an opponent. Conquer him with love.
Mahatma Gadhi*

[[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.


Re: [R] Error Help only 0's may be mixed with negative subscripts

2014-01-31 Thread Kehl Dániel
Dear Agapitus,

we do not know what your variables look like but I assume ((zlim[2] - 
z_invDist)/zlen) * 7 produces a vector with both positive and negative 
numbert and you are using these numbers to extract elements of an other vector. 
If the numbers were all positive or negative, it would work, in this case R 
does not understand what you want.

Try
x - 1:5
x[1]
x[-1]
x[-1:1] #gives the same error

Before posting again you should read an Intro to R at 
http://cran.r-project.org/doc/manuals/R-intro.pdf

best wishes
daniel

ps: Gandhi instead of Gadhi?

Feladó: r-help-boun...@r-project.org [r-help-boun...@r-project.org] ; 
meghatalmaz#243;: Agapitus Kato [agapitusk...@gmail.com]
Küldve: 2014. január 31. 10:01
To: r-help@r-project.org
Tárgy: [R] Error Help only 0's may be mixed with negative subscripts

Help Please. Iam drawing a plot i R_Studio but consistently get this error:
Error in colorlut2[((zlim[2] - z_invDist)/zlen) * 7] : only 0's may be
mixed with negative subscripts--

*Whenever you are confronted with an opponent. Conquer him with love.
Mahatma Gadhi*

[[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.

__
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.