[R] Rasterize function with maximum in R

2017-11-15 Thread Ashraf Afana via R-help
Hi all, I have some concerns regarding the rasterize option in R and I would like to know if the fun=max in rasterize in R provides similar results to the one achieved by using "Polygon to Raster using maximum-combined-area" in ArcGIS? I'm trying to rasterize a habitat layer to a raster of

[R] Iterate in a Spatial Polygon Dataframe in R?

2017-10-11 Thread Ashraf Afana via R-help
Hi all,  I'm trying to iterate in a SpatialPolygonDataFrame thatcontains 110 features. I tried to use the following code  iterate.spdf =function(x){ for (i in 1:nrow(x)){ p = x[i, ]} return(p)} but with no success as it returns with aSpatialPolygonDataFrame that contains onlyone feature. The

Re: [R] build a SpatialLines object from a list

2017-09-26 Thread Ashraf Afana via R-help
   On Mon, Sep 25, 2017 at 3:40 PM, Ashraf Afana via R-help <r-help@r-project.org> wrote: Hi all,I'm trying to build a SpatialLines object from a list that contains 124 river segments. Each segment in the list contains the x,y coordinates. I'm using the following code to create the SpatialL

[R] build a SpatialLines object from a list

2017-09-25 Thread Ashraf Afana via R-help
Hi all,I'm trying to build a SpatialLines object from a list that contains 124 river segments. Each segment in the list contains the x,y coordinates. I'm using the following code to create the SpatialLines object, but it just retrieves one segment. Any suggestions? test.func = function(x){