Skip to content
Prev 80718 / 398502 Next

problems with for: warnings and segfault

On Fri, 11 Nov 2005, Ronaldo Reis-Jr. wrote:

            
At step one you have xcoord[2] <- 5+1, so xcoord is c(5,6)
At step two you have xcoord[3] <- xcoord+2, so you are trying to replace 
one value with two, and the same for ycoord.
...

It is much better practice to create a vector with the size you are going 
to need it.
Both since R should not segfault, but mainly the latter.