Questions tagged [r]

Statistical computing language and software environment.

Filter by
Sorted by
Tagged with
3 votes
1 answer
1k views

Spatial Interpolation Methods like PRISM

I am looking for some kind of software (free software) that allows me to make an interpolation like PRISM software. The interpolation used in PRISM is a local regression and accounts for ...
  • 2,546
8 votes
3 answers
1k views

Identification of consecutive points within a specified buffer

I have a point file, hourly relocations of an animal, and I want to be able to place a buffer around each point and calculate the number of subsequent points which are within the buffer zone. I am ...
  • 303
4 votes
1 answer
9k views

How to select a Subset of PolySet data in R?

I am using the PBSmapping package in R to model data from diva-gis. I can read in the shapefiles and plot them with no issue. library(PBSmapping) df = importShapefile("/path/df.shp") plotPolys(df) ...
  • 263
7 votes
2 answers
9k views

Converting NZMG (or NZTM) to latitude / longitude for use with R map library

I am a statistician with no background in GIS so apologies for the newbie question. We routinely use R for a range of statistical and graphic analysis and are interested in using its map library to ...
3 votes
1 answer
412 views

Generic comparison for kriging in geoR and ArcGIS

I am going to do a project based on kriging. The targeted area would be as big as United States and my grid would be 10km*10km. I am wondering the differences of efficiencies for the methods ...
  • 2,205
7 votes
2 answers
4k views

Creating a raster of the residuals of a regression between two rasters

I am trying to create a raster of the residuals of a regression between two rasters. i.e. I would like to carry out a regression of one raster against another of the same extent and plot the residual ...
9 votes
2 answers
25k views

How to overlay map layers (shp and csv) in R?

This is a crosspost from stackoverflow. I know very little about GIS software and am doing all my mapping in R. Apologies in advance if this is too basic question. Let's say I have two shapefiles from ...
  • 263
44 votes
2 answers
51k views

How can I convert data in the form of lat, lon, value into a raster file using R?

I have a data set of values over a km grid in the continental U.S. The columns are "latitude", "longitude", and "observation", e.g.: "lat" "lon" "yield" 25.567 -120.347 3.6 25.832 -120....
  • 1,883
3 votes
3 answers
2k views

NA values in dbf when exporting shapefile from R with writeOGR?

I´m writing an esri shapefile from R (2.14.1) on windows, using writeOGR in the rgdal package, in the resulting dbf file, NA values in the spatialpointdataframe (in numeric columns) are not translated ...
  • 427
1 vote
1 answer
847 views

Administrative level and coordinates from Yahoo GeoPlanet WOEID

The Yahoo GeoPlanet data can be freely downloaded from: http://developer.yahoo.com/geo/geoplanet/data/. If I understand it correctly, each WOEID corresponds to a unique location on earth, with ...
  • 263
3 votes
1 answer
107 views

How to determine if feature A and B are located in the same room?

I have created a map using MapWindows like the following: A little explanation here, the is a map of an elderly home. The yellow boxes are room and the white rectangles inside the yellow boxes are ...
  • 499
12 votes
3 answers
8k views

How to get the second nearest neighbor between two point patterns in R?

Is there a way to get the distances for the second nearest neighbor between two point patterns in R? The spatstat package has a function called nncross but it only applies to the nearest neighbors ...
  • 17.2k
17 votes
1 answer
2k views

Monte Carlo simulation using QGIS and pgRouting on optimal sidewalk construction

I am new to spatial analysis and would appreciate some general direction on a project I am attempting, outlined below (I am starting from scratch). GOAL: To find the best locations to install 2000 ...
  • 321
75 votes
6 answers
226k views

Opening shapefile in R? [closed]

I need to open a shapefile from ArcMap in R to use it for further geostatistical analysis. I've converted it into ASCII text file, but in R it is recognized as data.frame. Coordinates function doesn't ...
  • 751
9 votes
3 answers
20k views

Converting point to lat lon? [duplicate]

I have received a shapefile with measurement points to be analyzed, but no matter how I try, I can't find how to convert to lat lon. I suppose it would be good to know the projection but when I look ...
  • 824
6 votes
1 answer
5k views

Spatial distance join between polygon and points using R

I'm figuring out how to do a Intersection (Spatial Join) between point and polygons from shapefiles. My idea is to get the closest points and those points that match completely inside the polygons. In ...
22 votes
2 answers
16k views

Instantiating spatial polygon without using a shapefile in R

So, the usual way we read a shapefile in R is via the maptools package, like this: sfdata <- readShapeSpatial("/path/to/my/shapefile.shp", proj4string=CRS("+proj=longlat")) However, I have a use ...
0 votes
1 answer
3k views

dependency ‘stringr’ is not available for package ‘rgeos’

Attempting to install rgeos package fails. Detailed error logs as follows:- > install.packages("rgeos", repos="http://R-Forge.R-project.org") Installing package(s) into ‘/Users/calvin/R/x86_64-...
4 votes
1 answer
124 views

Is it possible to use RPy/RPy2 in a Geoprocessing Script that is exposed as a GP Task on ArcGIS Server?

Is it possible to publish a Script tool that uses the RPy/RPy2 module (or more generally any Python-to-R link) to ArcGIS Server 10 SP2? If so, what specifically do I need to do, i.e. Install R on the ...
17 votes
1 answer
39k views

Converting a polygon into a raster using R

I'm trying to convert a shapefile into a raster within R. My approach is to read in the raster as follows: library(rgdal) # Loads SP package by default demo <- readOGR('F:/data/', 'shapefile') # ...
  • 16k
39 votes
7 answers
51k views

Clustering spatial data in R? [closed]

I have bunch of data points with latitude and longitude. I want to use R to cluster them based on their distance. I have already taken a look at this page and tried clustTool package. But I am not ...
  • 491
4 votes
1 answer
2k views

Superimpose grid on points, then aggregate points within each grid cell

I have a vector of presence/absence values (1,0) and a matrix of x,y coordinate data (projected) specifying the spatial position of each value (about 25,000 in total). I'd like to aggregate the point ...
  • 103
33 votes
1 answer
40k views

Raster legend in R: how to colour specific values?

I have an elevation model plotted in R r <- raster("example.dem") plot(r, col = topo.colors(20)) Some of the values are below sea level (0), and I'd like to have those display in red. How can I ...
  • 14.5k
14 votes
2 answers
7k views

Random sampling of raster using R?

Is there a straightforward way of randomly sampling a raster so that the output of the process is a raster? I'm using an example that I found on the r-sig-geo list and I have also tried the ...
  • 16k
7 votes
2 answers
1k views

Is it possible to run an R script on a layer in QGIS?

I'd like to run an R script on a layer loaded in QGIS (to rotate a set of points created there using the Vector:Research Tools:Regular Points tool). I thought ManageR might work but cannot get it ...
  • 14.5k
4 votes
1 answer
2k views

Simulation envelopes and significance levels

Many spatial analysis packages provide Monte Carlo techniques to simulate upper and lower “envelopes” for a summary statistic as a function of distance (e.g. K-function, nearest neighbor, etc…). I’...
  • 633
10 votes
4 answers
16k views

How can I export raster data from Arcmap to an R *.grd file format?

I want to work with raster data in R, but I have problems exporting my raster dataset from ArcMap. By "export data"/GRID I get a file with an *.aux extension. What I need is *.grd. Can anybody help ...
  • 101
12 votes
1 answer
805 views

Randomly altering raster map of habitat types?

I have a raster of habitat types for a specific area in Scotland. I need to create future habitat scenarios with changes in habitat to assess the population viability of a bird species. For example, ...
4 votes
3 answers
1k views

Relationship between sp package in R; MapWindow; ArcGIS/QGIS?

I am using ArcGIS at office for some visualization work, but I feel it kinda dump to performing the same tasks several times for visualizing some data on different maps. I am think of automating it ...
  • 499
4 votes
0 answers
174 views

What open source solution would work best for auto extracting features from satellite images? [duplicate]

Possible Duplicate: Feature Extraction - Land cover I have been looking for an open source solution which would allow me to define a region (or collection of images) and extract features from ...
10 votes
4 answers
3k views

Problems with NA values when reading .DEM file with R 'raster' package in Windows

I am trying to read a raster file in a .DEM format on windows using the 'raster' package in R. I get problems with NA values, when loading the data into R in Windows 7, but I do not have the problem ...
  • 2,943
29 votes
7 answers
8k views

Speed of various raster data formats

I'm having trouble locating any discussion or comparative benchmarking of different raster file formats (e.g., for use in data analysis in R). Does anybody have any insight into why particular formats ...
  • 291
10 votes
3 answers
2k views

How to cluster points based on a kernel density?

I have a large dataset with 36k points representing commercial land uses, each with a field containing the square footage. I have run a kernel density analysis on this dataset, producing a raster ...
  • 1,163
17 votes
6 answers
2k views

Seeking current geostatistical analysis classes/events

I am interested in geostatistics. I am not very programmatically inclined but have been following several lists with this theme. One being the R filter on Stack Exchange where I get occasional digest ...
5 votes
1 answer
5k views

How to read multiple .gpx files in R [closed]

Suppose I have a number of .gpx files (these contain GPX waypoint data from a Garmin eTrex). I want to load them into R with different names and manipulate them. I can read one file thus: library(...
  • 662
9 votes
3 answers
830 views

Making county-level shapefile from set of points at 30 x30 km spacing using ArcGIS for Desktop?

I have a data set in csv form, like: latitude, longitude, value -45, 45, 10 .... I would like to calculate county level means from these data, using either ArcGIS or R+grass. I have the ArcGIS USA ...
  • 1,883
10 votes
4 answers
751 views

Does Google Maps API provide statistical tools or even raster to vector conversion?

I am working with a web developer who is working with Google maps API, trying to determine what pre-processing steps I should perform (e.g. in R and GRASS), and what can be done within the google maps ...
11 votes
1 answer
968 views

Kriging on GRASS+R - cannot allocate vector of size 146.5 Mb

I'm trying to do a groundwater elevation map with an Ordinary Kriging on R, but always resulting on the lack of memory cannot allocate vector of size 146.5 Mb allocation (windows xp 32bit). ...
  • 501
3 votes
1 answer
662 views

spgrass6 and GIS_LOCK

I would like to thank's everyone first, i learn a lot here (gis.stackexchange) about GIS. I have one question about the use of GRASS within R session, i'm able to do some basic task, but i have one ...
  • 300
4 votes
2 answers
988 views

Altitude Above channel in GRASS 6.4

I'm fairly new to the GIS world and GRASS (come from econometric background), I would like to do some species distribution modeling using R and GRASS. So I started to read the book of Tomislav Hengl :...
  • 300
4 votes
1 answer
6k views

Convert a shapefile with northing/easting to ASCII raster with latitude/longitude

Linked below is a polygon shapefile whose projection is NAD83 and whose values are LU/LC codes. Coordinates are meters of northing and easting. I would like to convert it to an ASCII raster with ...
  • 398
11 votes
3 answers
5k views

R: Download a large DEM, change projection, and adjust to smaller scale

This is a process that takes just a few seconds in GIS software. My attempt to do it in R uses a large amount of memory then fails. Is there something wrong in my code, or is this just something R ...
  • 398
9 votes
2 answers
6k views

R: overlay a line on a raster stack/brick, and get profile of cell values along the line

I've combed through R's raster functions and vignettes and can't seem to get this working. I want to specify a line/vector across a raster stack (a DEM and possibly related variables), and get a ...
  • 398
35 votes
3 answers
94k views

Finding centroid of cluster of points using R

While searching the web, solutions for finding centroids of polygons come up rather often. What I'm interested in is finding a centroid of a cluster of points. A weighted mean of sorts. Can you ...
12 votes
1 answer
565 views

Spatial operators in R?

How can I do spatial selections or filters in R? I can do this in PostGIS using (e.g.): SELECT * FROM mypoint, mypoly WHERE ST_Within(mypoint.geom, mypoly.geom); and it is similarly a piece of cake ...
  • 40.2k
15 votes
3 answers
4k views

Using R with ArcGIS for Desktop (without using GME)? [duplicate]

I am trying to learn R generally and making statistics for maps. I found some useful tricks for making maps with it but it is not the best you can do. My everyday GIS program is ArcGIS. How I can use ...
  • 3,366
13 votes
3 answers
5k views

Spatio-temporal interpolation in R or ArcGIS?

I'm trying to calculate average rainfall value from a number of points using Inverse Weighted Distance tool in ArcGIS 9.3. My problem is that: each point has it own time series, therefore the ...
  • 389
44 votes
10 answers
10k views

Seeking spatial R tricks

R is becoming pretty strong tool for handling and analyzing spatial data. I learned some useful things through questions like these at SO and thought it might be useful to have something simmilar, but ...
15 votes
7 answers
4k views

How to implement value-by-alpha map in GIS?

I've been doing some background reading about cartograms recently and stumbled upon interesting alternative - value-by-alpha maps. Concept is described in more details here and full paper is ...
  • 10.4k
3 votes
2 answers
1k views

Which ESRI defined geographic transformation do I need to use to convert my " NAD83 Northern Virginia" data into WGS 1984 Web Mercator?

My title pretty much tells it all.. I have a number of datasets in which I want to batch project from NAD83 Northern Virginia Datum into the correct Web Mercator projection.. When I do a straight ...
's user avatar