Agapitus Kato
2014-Jan-31 09:01 UTC
[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) * 70000] : 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]]
Kehl Dániel
2014-Jan-31 11:12 UTC
[R] Error Help "only 0's may be mixed with negative subscripts"
Dear Agapitus,
we do not know what your variables look like but I assume ((zlim[2] -
z_invDist)/zlen) * 70000 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-bounces at r-project.org [r-help-bounces at r-project.org] ;
meghatalmazó: Agapitus Kato [agapituskato at gmail.com]
K?ldve: 2014. janu?r 31. 10:01
To: r-help at 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) * 70000] : 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 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.