Statistical computing language and software environment.

learn more… | top users | synonyms

1
vote
1answer
265 views

Function that applies another function to nearest neighbors of a specified location?

I'm sure this is quite basic, but I just couldn't find anything appropriate: I am looking for a function that applies another function to variables of a SpatialPointsDataFrame, but only for locations ...
14
votes
3answers
483 views

How to determine if trees within forest gaps are clustered?

The attached dataset shows approximately 6000 saplings in approximately 50 variable sized forest gaps. I am interested in learning how these saplings are growing within their respective gaps (i.e. ...
5
votes
1answer
359 views

Stats on individual grid points nearest neighbours

First, thank you for this extremely useful and easy-to-access forum! I have shp of points where each point is the centroid of the individual cells of a 1*1km grid (~ 500 000 points). For each of ...
6
votes
1answer
512 views

How to convert an Erdas training set to .csv?

I am working with Erdas Imagine's Signature Editor to perform maximum likelihood classification. I need to use the same training set created in Erdas for other classification using R. Is there a way ...
14
votes
2answers
2k views

Performing Raster Noise Reduction and Edge Smoothing?

I have a raster image like this I want to delete the isolated noise point and smooth the edge (say the white single points, and I want the edges of the entity look smooth). How can I do this in ...
4
votes
3answers
605 views

How to create an intensive map of Russia using QGIS or any other software?

I am trying to create an intensive (heat) map of Russia. I have an excel sheet of 36 Russian regions and their corresponding values. I know that there were similar questions: How to create a map ...
1
vote
1answer
1k views

rpy2 installation ERROR “Tried to guess R's HOME but no R command in the PATH”? [closed]

I tried to install rpy2 (pip install rpy2). I want to use the SDAPP4 extension with QGIS (QGIS shows up the message missing rpy2...). The system tells me always the same error: Tried to guess R's HOME ...
14
votes
2answers
3k views

Using R to calculate the area of multiple polygons on a map that intersect with another overlaid polygon

I have a shapefile downloaded from the Ordnance Survey that gives electoral ward (division) boundaries for a county of the United Kingdom. I have successfully used R to load the shapefile and plotted ...
11
votes
1answer
2k views

How to perform Random Forest land classification?

This is a follow-up to a previous post: Machine Learning Algorithms for Land Classification. It seems that the Random Forest (RF) classification method is gaining much momentum in the remote ...
4
votes
1answer
699 views

book/tutorial on using rpy2 in python for kriging?

I am proficient in Python, but have no knowledge of R. Can you suggest a good tutorial in using rpy2 or any other R library to perform Block/Cokriging "Kriging"
3
votes
1answer
359 views

How to reproject a raster to Winkel Tripel projection?

I'm trying to project a raster map (in ASCII grid format) from longlat to the Winkel Tripel projection. But I'm running into errors, for instance gdalwarp won't accept the proj-string. $ gdalwarp ...
3
votes
0answers
244 views

How do I access layer attributes from within QGIS' manageR plugin?

This is probably a fairly basic question, but searches for manageR come up with a lot of noise, and there's no manageR tag. What I'd like to do is load the attributes from a particular field of a ...
1
vote
2answers
604 views

Rename a SpatialPolygon class object in R

I am completely new to GIS but am quite familar with R. I was able to dissolve some zip codes into a larger sales territory. For reference, my previous question is located here. However, because ...
1
vote
3answers
478 views

Merge Zip Codes to Create new sales Markets

Let me preface this question by saying I am very novice with respect to GIS. With this in mind, I am looking to merge zip codes into sales territories. Instead of plotting data by zip code, I want to ...
4
votes
2answers
520 views

What is the cause of 'tearing' of polygons (artifacts) using R, ggplot and geom_polygon?

Thanks to the answer given in this question I have been able to subset and draw a map of electoral divisions in part of the UK, in this case Pembrokeshire. The resulting data frame is large and ...
7
votes
1answer
971 views

How can I use fortify() to create a filtered R data frame from a shape file?

I am in the process of building a ggplot choropleth map of population in administrative areas in Wales. I have downloaded the Boundary-Line data from the Ordnance Survey and extracted what seems to be ...
7
votes
1answer
5k views

How do I change the polygon fill color and border color for SpatialPolygons objects?

I have SpatialPolygons or SpatialPolygonsDataFrames which I'd like to plot. How do I change the color using the three plotting systems in R (base graphics, lattice graphics, and ggplot2)? Example ...
2
votes
2answers
431 views

How to single out country data from a world data map?

Say that i have two "data sources"; A global map of average wind speeds, A shape file (or similar information) of all country borders in the world. How do i combine these two sources and extract ...
4
votes
2answers
396 views

R- alphahull - duplicate points error help

I came across R function -alphahull- and believe it is the best option to turn gps points into a polygon (3 or 4 days worth of gps points across residence/neighborhood for each of 300 subjects). ...
4
votes
1answer
440 views

Iterate features on SpatialPolygonsDataFrame in R

I have a SpatialPolygonsDataFrame object. Is there way to use apply on this object rather than using a for loop to iterate features in this object?
27
votes
2answers
2k views

How can I conduct Geographically Weighted Principal Component Analysis using ArcGIS, Python and SPSS/R?

I am after a description/methodology for conducting a Geographically Weighted Principal Components Analysis (GWPCA). I am happy using Python for any portion of this and I imagine SPSS or R being used ...
4
votes
0answers
350 views

Rgeos drops associated values when intersecting polygons

I am trying to intersect two SpatialPolygonsDataFrames and get a SpatialPolygonsDataFrame as the result. Unfortunately, using the gIntersection function from rgeos (which works impressively quickly ...
6
votes
2answers
729 views

Convert several SpatialPointsDataFrames to raster

There are 100 SpatialPointsDataFrames in my Workspace. I loaded them on this way: filenames <- list.files(path="", pattern="XYhectareTravelTimes_ez+.*shp") for(i in ...
2
votes
2answers
1k views

[R]Function to calculate mean for missing or NA values in a dataframe

I am trying to develop a function that will calculate a mean lat/long for my missing or zeros location (lat/long) data in my dataset. I have locations for many SETS within the same TRIP, which tends ...
5
votes
3answers
302 views

Create Zonal Grid in R

Suppose I have a n*n raster, and I want to create k square blocks (k can be divided exactly by n*n ) for zonal analysis: for example, when n = 4 and k = 4 a 4*4 raster is create with value 1 1 2 2 ...
1
vote
0answers
707 views

Raster grid for zonal statistics in R

I have two raster layer, the first one r is my zonal mask as a raster grid, and I created as: ext <-extent(Yraster) r <- raster(nrows=32,ncols=32,ext) r[] <-(1:ncell(r)) and project it ...
3
votes
1answer
207 views

Extract pixel value for corresponding gps location in R

I have animal gps data with several locations for each day and regular gaps of several days when no location of the animal was recorded. Additionally, I have satellite data in intervals of 16 days. I ...
0
votes
2answers
268 views

Detect whether there is a spatial polygon in a spatial extent

Given a spatial extent (for example cbind(c(0,0),c(10,10)),I want to see whether there is a part of a SpatialPolygons falls in this extent? How can I do this? Thank you very much!
2
votes
2answers
1k views

How to create a map with states by attribute value?

I'm using Qgis, but I am quite familiar with R and python. So I could use any of these. I want a map of mexico but want to color the stats according to a certain variable. It goes from 0 to 100. So ...
2
votes
1answer
863 views

Opening .lyr file via rgdal/OGR

According to this answer I can read in a .lyr file via OGR as long as it was made with ArcGIS version 10. I have such a file (from the ArcGIS Maps & Data page) but I can't quite make R's readOGR ...
1
vote
1answer
106 views

Mapping reefs in Madagascar using R

I need to project a number of reef sites onto the coastline of southwest Madagascar. I was hoping to use R for this as I find ArcGIS too big and clunky. I need to create a basemap for both the reefs ...
2
votes
0answers
139 views

Moving point on OpenStreetMap route

Basically I generate random numbers in R language which are indeed times between bus arrivals. I need to simulate a moving point(a bus) in OpenStreetMap by using this generated numbers. I have read ...
12
votes
2answers
550 views

Need a spatial database that can be used by QGIS and R

I'm quite new to QGIS and I'm searching for a simple way to create a Database that allows me to use the tables in QGIS and R. I have a lot of data stored in Excel spreadsheets wich will be used for ...
10
votes
2answers
245 views

Count raster value in a bounding box (spatial extent)

I have simple question: given a bounding box, how can I count the number of specific values (say, I am interested in the number of value == 1 ) in a raster in 1) arcpy, or 2) raster package in R?
5
votes
3answers
872 views

Kriging points in a raster in R

I wonder if there is a way to interpolate xyz points in a raster within certain bounds using R?. In arcgis this is call interpolation with barrier. i wonder if there is something similar in r?. I ...
4
votes
2answers
290 views

No intersection found between polygons I know intersect!

I'm using two geographies: one is made up of small areas (about 2200), the other large areas (about 70). Both cover all of Australia, and the small areas are not necessarily nested inside large areas. ...
2
votes
1answer
276 views

How to analyze temporal point data in R?

I have XY coordinate data of water depth (n = 30) where each coordinate has water depth attribute data for multiple dates from 2000 to 2007. I have imported the data in r for statistical analysis. I ...
7
votes
2answers
2k views

Proper way to rbind SpatialPolygonsDataFrames with identical polygon IDs?

What's the proper R idiom for rbinding SPDFs together when the IDs overlap? Note that here (as is often the case) the IDs are basically meaningless so it's pretty annoying that I can't just make ...
11
votes
1answer
3k views

Projecting sp objects in R

I have a number of shapefiles in different CRSs (mostly WGS84 lat/lon) that I'd like to transform into a common projectly (likely Albers Equal Area Conic, but I may ask for help on choosing in another ...
2
votes
2answers
990 views

How do I use ranges for raster colour map in QGIS

I have a raster layer in GeoTIFF format, with continuous data values between -1 and +1. For the colour map, I would like... >0 to be green = 0 to be grey <0 to -0.25 to be pink <-0.25 to ...
5
votes
4answers
3k views

Dissolve ploygons in QGIS or Grass to new polygons of defined population sizes

I have a shapefile with 3800 polygons representing the smallest administrative areas in Ireland. Many of these, in rural areas, have tiny populations, under 100 people. In urban areas, all would have ...
10
votes
1answer
545 views

How to visualize azimuthal data with uncertainties?

I am trying to make a figure showing azimuthal data with a different range of uncertainties at each point. This oldschool figure from a 1991 paper captures the "bowtie plot" idea that I'm aiming for: ...
11
votes
4answers
1k views

How can I generate irregular grid containing minimum n points?

Given a large (~ 1 million) sample of unevenly distributed points - is it possible to generate irregular grid (in size, but could also be irregular in shape if that is possible?) that will contain ...
3
votes
1answer
351 views

How to stop writeOGR from abbreviating Field Names when using “ESRI Shapefile” driver

I'm currently using the following script to add some attribute data from a table to lots of individual shapefiles: library(rgdal) specieslist <- read.csv("SpeciesList1.txt", header=F) attdata ...
13
votes
2answers
834 views

How to generalize SpatialPolygons and conserving topology in R?

I would like to generalize a SpatialPolygonsDataFrame in R to make plotting more efficient. The polygons I have result in huge pdf plots that are slow to load and hard to integrate into a document. ...
10
votes
3answers
3k views

How to find and merge duplicate points?

I have two point shapefiles: Red and Blue. Each point shapefile has a z value which represents a radius (i.e. represented as buffers in the example). A duplicate point is defined as a point that ...
2
votes
1answer
760 views

Defining datum for Lambert Azimuthal Equal Area and converting to geographic coordinates

I posted this question to a specialised mailing list for spatial data analysis using R here but didn't recieve a response. I am working with shapefiles and rasters in R, and I am unsure if I am ...
4
votes
2answers
870 views

How to calculate area of 1 x 1 degree cells in a raster

I have a simple array (not geo-referenced in any way) in Matlab (which is not a language I know a huge amount about...so I can export it to other languages if needed) which has the dimensions 180 x ...
5
votes
2answers
658 views

rpy2 installation on Mac OSX. A still unresolved problem on StackExchange and rpy-list [closed]

following lgautier's advice on rpy2 installation on Mac OSX, I posted my request on rpy-list and got in touch with Yair Benita who said he could only install rpy2 through his default Mac OS X python ...
1
vote
1answer
520 views

rpy2 installation on Mac OSX

I'm desperatly trying and retrying to install rpy2 on my Mac OS 10.6 in order to run SDA4PP plugin on QGIS. My version of R is 2.14.0 and it was obviously compiled with the option --enable-R-shlib ...