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

Kehl Dániel kehld at ktk.pte.hu
Fri Jan 31 12:12:26 CET 2014

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.

x <- 1:5
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

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