Statistical computing language and software environment.

learn more… | top users | synonyms

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
686 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
354 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
241 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
590 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
468 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
517 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
949 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
393 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
437 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
345 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
710 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
301 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
700 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
205 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
266 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
853 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
545 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
864 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
286 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
272 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
1k 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
977 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
542 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
342 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
826 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
755 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
840 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
650 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 ...
8
votes
2answers
1k views

How to Find the Average Raster Value of an area defined by a shapefile using R?

I have a set of raster images which represent a specific month over the years, and I want to make a timeline of the average values of an area using a shapefile. How do I extract the values from the ...
5
votes
2answers
417 views

Using rpy2 in ArcGIS

I have a 3rd party python geoprocessing script that requires rpy2, and thus also r. What is the best way to get these working together? Using R with ArcGIS Desktop says the most useful option for ...
2
votes
2answers
173 views

Go from multiple rasters to R compatible table

I have a set of geocoded, pixel-aligned rasters which I would like to use in a model in R. I would like to produce a table of data that can be imported to R, in which there are as many columns as ...
14
votes
3answers
593 views

Ecological geospatial conundrum

I am looking for a different, more elegant solution to a spatial statistics problem. Raw data consists of an x-y coordinate for each individual tree (i.e. converted to a point .shp file). Although ...
7
votes
4answers
11k views

How to convert zip codes to latitude and longitude?

I have a data set that includes a list of zip codes. Is there a way in R to convert these zip codes to latitude and longitude coordinates?
8
votes
4answers
2k views

R spplot tutorials

I'm in need of some tutorials/books/other training materials which cover how to use the spplot function in the sp package in R properly. As with many of these functions, it seems very powerful, but ...
2
votes
1answer
383 views

Recreating A Lat/Long Grid Using a Specified Formula

I'm trying to recreate the Gridded Mercury emissions 2000 (0.5 x 0.5 degree grid) designed by the Arctic Monitoring and Assessment Programme. The file is in ASCII format, but without any coordinates. ...
3
votes
2answers
726 views

Clip depth contour with spatial polygon

I need to somehow combine my Spatialpolygons with my depth contour, but not sure how do to so. Maybe create a SpatialPolygonsDataframe? This is what I've done so far: > class(subarea0) #This is ...