Skip to content
Prev 25360 / 29559 Next

Change Lines'IDs within a SpatialLines object

On Tue, 7 Feb 2017, marta azores wrote:

            
The values contained in row.names() of data.frame objects and similar are 
always seen as being of type character. Consequently, if you try to assign 
a vector of type numeric, it will fail.

Never, ever use @ - these are exclusively for programming internally. Use 
splndf$Idkey, which is its accessor method. Either use 
as.character(splndf$Idkey), or possibly formatC(splndf$Idkey, format="d", 
flag="0", width=<>) for left-padding of zeros to your choice of width if 
the column is integer but should be like "0010", and integer 10 is stored.

Roger