Re: [R] conversion error from numeric to factor in raster: Error in 1:ncol(r) : argument of length 0, r command: as.factor()

2014-05-07 Thread Stefan Schmidt
Hello, thanks a lot for the fast response and the hint! Actually, it helped to already integrate as.factor in the generation of the raster. This is also working for uploading or diverse other raster functionalities like projection, e.g. as.factor(raster(C:\\...\\r.tiff)) or

[R] conversion error from numeric to factor in raster: Error in 1:ncol(r) : argument of length 0, r command: as.factor()

2014-05-06 Thread Stefan Schmidt
Hello together, I was wondering how I can solve the following conversion problem of a raster file: when I try to convert the values from the raster (r) from numeric into a factor via as.factor(r) always the error appears: Error in 1:ncol(r) : argument of length 0. r - raster(ncol=5, nrow=5)

Re: [R] conversion error from numeric to factor in raster: Error in 1:ncol(r) : argument of length 0, r command: as.factor()

2014-05-06 Thread David L Carlson
Does values(r) - as.factor(1:ncell(r)) do what you want? - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On