Statistical computing language and software environment.

learn more… | top users | synonyms

1
vote
0answers
5 views

How to combine 3 rasters: 1 without Geoinformation, 1 with Lat-coord-values and 1 with Long-coord-values

I have multiple raster images without geoinformation. The geoinformation is stored seperately in two other rasters: one contains the Lat-coordinate of every pixel, the another the Long-coordinates. So ...
0
votes
1answer
16 views

R filter shapefiles with dplyr

How to filter shapefiles data in R with dplyr and then put it in a leaflet map? not reproducible example sorry: library(dplyr) library(leaflet) library(sp) library(maptools) library(rgdal) ...
0
votes
1answer
22 views

Overlaying grids with a polygon to determine the average value of the overlapping grids for that polygon

I would like to add the average, minimum and maximum value of, let’s say soil moisture (variable "value" in my case), to each NUTS3 region (= a NUTS3 region is a polygon of a certain small area in ...
1
vote
1answer
26 views

Spatial representation of Data

I'm a new users of spatial analyses packages in R. I have created a SpatialPolygonsDataFrame which contains a number of rectangular polygons that i named "Square1" to "Square64". Until now there is no ...
10
votes
2answers
195 views

Point overplotting on maps in R (e.g. with ggplot2) - how to push points to the side, mark original positions, combine close-by points …?

I've got a database containing languages, their longitudes and latitudes and a feature value (either category 1, category 2 or both - in the plot these are marked red, blue and green respectively). ...
0
votes
2answers
254 views

projection conversion from mercator to google maps format

Is this spTransform(Finland3, CRS("+proj=longlat +ellps=WGS84 +no_defs+ellps=WGS84 +towgs84=0,0,0 ")) the right way to project a shapefile with this projection coord. ref. : +proj=merc +lon_0=0 ...
1
vote
0answers
23 views

Performing Theil-Sen regression on raster data by R software

I have seven NDVI raster layers (in ERDAS img format) of an area. Each NDVI layer is the peak growing time of that year. I want to do trend analysis of NDVI values change over the years pixel by ...
4
votes
2answers
43 views

how to create geo-referenced random data?

I'm writing a dissertation on different parameter settings in GWR . In order to perform tests I'd need the availability of geo-referenced data that show some sort of spiatial correlation (i.e. values ...
1
vote
1answer
32 views

Transforming coordinate in the Swiss reference system LV95 into LatLong/WGS84

I would like to transform coordinates expressed in the Swiss reference system LV95 into LatLong/WGS84. On the website of the Swiss topography centre, there is an application to do so, however ...
0
votes
0answers
22 views

Spatial segregation from a raster of racial distribution in the USA

I am trying to measure the degree of racial segregation at some geographic level (let's say the county level, for simplicity) in the USA. I have a shapefile with these geographic units. To do so, ...
3
votes
2answers
36 views

Add information from a cvs/text file to a raster shapefile based on latitude and longitude information

I have an empty raster shapefile that only contains the latitude and the longitude of the centroids of each grid. I now want to add an extra variable to each grid cell coming from a cvs or txt file. ...
1
vote
0answers
37 views

How can I conduct dimension reduction using Geographically Weighted Principal Component Analysis?

I want to know how to compute the importance of components for geographically-weighted-principal-component-analysis(gwpca)? That is, I want to reduce dimension according to cumulative proportion of ...
1
vote
1answer
33 views

ggmap: clip a map

I'm using ggmap to grab Washington DC and I have a shapefile that I downloaded from here: library(ggplot2) library(ggmap) library(maptools) dc = get_map(location = 'DC', zoom = 12) nhbds = ...
2
votes
2answers
36 views

Merge multiple SpatialPolygonDataFrame into 1 SPDF in R (analogue to “Merge” Tool in ArcGIS)

I have created 2 polygons in QGIS. Using them in R, polygons become automatically SpatialPolygonsDataFrame (SPDF). I would like to merge them into single SPDF (as is super easy in ArcGis using Tool ...
1
vote
0answers
19 views

Unable to load Postgresql spatial data in R (with rgdal)

I'm trying to load spatial data from a postgresql database in R, using functions from the package rgdal, but I'm having trouble getting the functions to work. For example, when trying to read a ...
1
vote
0answers
4 views

Error executing GRASS function i.topo.corr from R [closed]

I am attempting to topographically rectify Landsat data using the i.topo.corr GRASS function from within R using the rgrass7 package. My code is as follows: execGRASS("i.topo.corr", flags = "i", ...
0
votes
0answers
20 views

Error during rasterization?

Cities are SpatialPointsDataFrame cities<-readOGR(dsn=".",layer="cities") r.raster <- raster() extent(r.raster) <- extent(cities) res(r.raster) <- 100 cit.rast<- ...
2
votes
1answer
79 views

How to plot certain values of a column in R?

Lets say we have a shapefile of cities with a column called category cities@data category A B A C A A B C How can i plot the A category only etc? Tried c<-cities$category[A] ...
4
votes
2answers
89 views

Dissolving/Unifying Ill Behaved/Irregular Polygons in R

I'm working on a project involving bringing together multiple subjects circling difficult to find parts of an image. The output from users is pretty awesome. Cool, right? However, what I want is ...
0
votes
1answer
31 views

How to do union that results to a SpatialPolygonDataFrame in R?

I have the following code coastline<-readOGR(dsn=".",layer="shp") wetlands<-readOGR(dsn=".",layer="shp") wetb<-gBuffer(wetlands,width=500,byid=T) ...
5
votes
1answer
181 views

Create raster with grid cells values based on area covered by polygons

I have a polygon data with area covered by the forests (data is here - https://www.dropbox.com/s/zgckliydalljw6a/sp_data.zip?dl=0). I want to convert polygons to raster. The value of each grid cell ...
3
votes
1answer
82 views

Difference between gdalwarp and projectRaster

I am trying to project a Raster. In R there is the projectRaster() function to to this (below a fully reproducibly example) : # example Raster require(raster) r <- raster(xmn=-110, xmx=-90, ...
1
vote
1answer
71 views

Big performance difference reading shapefiles between QGIS and R

I'm trying to read the belgian landuse ESRI shapefile from geofabrik.de: http://download.geofabrik.de/europe/belgium.html In QGIS it's just a matter of seconds, but in R using the readOGR function ...
1
vote
1answer
35 views

Find intersections between spatial lines and points using R

This question assumes that I'm using R with the sp and rgdal packages installed. Now that I have a set of spatial segments of class SpatialLinesDataFrame (called 'segmentData') and a set of spatial ...
4
votes
1answer
50 views

How to find the distance from a point to a polygon, via another point, in R

I am trying to calculate the distances between a central point, and the edge of a polygon, along straight lines drawn between the central point and another set of points (where necessary extended ...
4
votes
1answer
54 views

Grid vs. Polygon Overlay in R gives different results than in QGIS

I have a shapefile of range polygons. Each colored set of polygons represents a different group of species/genera/whatever. I next overlay a 5x5 grid onto this map. And then use join attributes by ...
2
votes
1answer
16 views

How to find the coordinates of the intersection points between two SpatialLines objects (or SpatialLines and SpatialPolygon edges)

I am try to find the co-ordinates of points where SpatialLines cross the edge of a SpatialPolygon. I have searched and searched, but can only find results such as over which tell me which lines cross ...
0
votes
1answer
28 views

Extracting Data from Raster based on Aspect Raster file

I have 2 rasters, ones shows aspect and another shows date of snow thaw. I want to extract the date of snow melt based on values from the aspect raster. For example I want all the snow thaw dates from ...
0
votes
0answers
45 views

How should i combine these rasters?

I have two buffers that i want to combine. I tried overlay with fun=function(x,y){return(x*y)} but 0*5 = 0 so it produces NA's.I don't know how to combine them the one buffer should be 500 and the ...
0
votes
0answers
7 views

Different results of lagsarlm in R and GeoDa spatial lag model with identical weight matrix?

I ran a spatial lag regression model in R using spdep. Due to cross-validation of my results and data-size, I ran the same model in GeoDa but the resulting indices didn't match. My data(slot): ...
2
votes
1answer
262 views

Plotting species distribution on map in R

I'd like to plot the distribution of a species on a map of Switzerland, following this tutorial. library(maps) library(mapdata) map('worldHires', 'Switzerland', xlim=c(5, 12), ylim=c(45,48)) From ...
1
vote
1answer
27 views

Merge a table with a shapefile (not the same dimension)

I am trying to merge a table with a shape file using R. The shapefile's database is bigger than the table and I need to have null or zero values where the two data sets don't match. Table data no. ...
2
votes
1answer
58 views

How is R used with ArcGIS for Desktop?

How is R used with ArcGIS for Desktop? I have seen posts talking about combining rasters while using R. I have not had much experience with R so not 100% certain of its capabilities. I had ...
0
votes
1answer
25 views

iterate over spatial polygon data frame in R

I am trying to iterate over the rows of a spatial polygon data frame in R, but cannot figure out the right indexing. I don't want to select by attributes, but rather just iterate over the spatial ...
-1
votes
1answer
59 views

How to reclassify a raster in R?

wet<-readOGR(dsn=".",layer="shp") #wetlands r.raster <- raster() extent(r.raster) <- extent(wet) res(r.raster) <- 100 wet.r <- rasterize(wet,r.raster) #rasterize plot(wet.r) ...
2
votes
1answer
44 views

Changing the extent of a Shape file in ArcMap for distrubution modelling in R

I am currently trying to create a species distribution model in R using maxent. The shape file I have is a map of an island. When viewed in ArcMap it has a set extent--in Lat and Long. I can ...
4
votes
1answer
50 views

Generate grid shapefile in R

I have the following shapefile of a 10x10 degree latitude/longitude grid that I created in QGIS. I can read it into R using the rgdal package. Grid<-readOGR(".","GridShapeFile") It has the ...
0
votes
2answers
55 views

Extracting a number of rows from a column in R

It's a shapefile that has a column with population. a$POP2001 It has 200 rows.I want to extract the settlements that contain less than 1000 residents, so i did this: s<-a[a$POP2001<1000,] ...
1
vote
1answer
80 views

How to reproject a raster from lat/lon to UTM in R?

i have to turn it into a UTM in order to make the buffer functional. wets<-readOGR(dsn=".",layer="shapefile") r.raster <- raster() extent(r.raster) <- extent(wets) res(r.raster) <- 100 ...
2
votes
1answer
42 views

Problem with regression kriging using the krige command in r

I want to perform regression kriging in R using gstat. I have a SpatialPointsDataFrame which is of this form: After I have run my glm model, in order to see which variables are statistically ...
0
votes
1answer
36 views

How to rasterize a shapefile in R? [duplicate]

I have several shapefiels that i have to turn into raster. Here's the coastline coastline<-readShapeSpatial("shp") r <- raster(ncols=90, nrows=45) jd<-rasterize(coastline,r) plot(jd) ...
0
votes
1answer
53 views

How to rasterize a vector dataset in R?

I would like to compare vector vs raster data. So i try to fix a problem using both ways. I made it in vector first : coastline<-readShapeSpatial("shp") wets<-readShapeSpatial("shp") ...
2
votes
0answers
30 views

Merge Spatial polygons from shapefiles

I have downloaded the shapefiles from the following website: http://download.geofabrik.de/europe/france.html Each zip contains a "landuse" shapefile and I want to merge all of them in one single ...
1
vote
0answers
12 views

Get the intersection of two dataframes of coordinates R

I have two dataframes with geocodes. The first looks something like this: spoints<- data.frame(x=c(1,2,3,4,5,6),y=c(6,5,4,3,2,1)) spoints maps a country. My second data frame looks like this: ...
1
vote
1answer
30 views

How to display the map within two longitude lines

I am new to GIS and I try to use the following code to display a pacific-centered world map. +proj=robin +lon_0=-198 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs However the map ...
1
vote
1answer
184 views

Clump and eliminate classes in a raster in ArcMap or R

after interpolation of sediment classes, I obtained a raster which looks like the image below (sample of the river). I would like to clump and eliminate areas within the raster that are below a ...
0
votes
1answer
32 views

How to plot a shapefile with colors according to a column numbers in R?

reclass = function(x){ ifelse(x == 0, 10, ifelse(x > 0 & x <= 20, 0, NA)) } arch$ranks<-as.factor(unlist(lapply(arch$ranks,reclass)) arch.col = topo.colors(nlevels(arch$ranks)) ...
0
votes
0answers
20 views

Problem with passing ranks to different buffers

This issue is really troublesome.i have a SpatialPointsDataFrame which refers to a city.I needed to perform a join with a dbf in order to attach the population column which i did thanks to a couple of ...
1
vote
1answer
21 views

Getting range value from exponential variogram model

I am using vgm() from the gstat library in R: variogr <-vgm(sill,"Exp",range=range,nugget=0) output <-krige(...,model=variogr) As you can see I'm using fixed psill and range values. Before ...
0
votes
1answer
44 views

How to rank according to a distance in a shapefile using R?

I would like some help on the theory behind this. I have done this in GRASS easily but doing it in R is not the same. Here's the table with the info, there are more tables similar to that but refer ...