Statistical computing language and software environment.
3
votes
0answers
97 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
171 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
228 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 ...
3
votes
2answers
151 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 ...
5
votes
1answer
202 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 ...
4
votes
1answer
947 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
205 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
149 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
197 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?
22
votes
2answers
793 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 ...
3
votes
0answers
126 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
210 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
257 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
169 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
281 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
126 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
143 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
428 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
291 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
69 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
80 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
347 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
161 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
377 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
179 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
163 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 ...
5
votes
2answers
315 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 ...
10
votes
1answer
610 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
281 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
1k 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 ...
9
votes
1answer
253 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:
...
10
votes
3answers
497 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
135 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 ...
12
votes
1answer
320 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.
...
6
votes
3answers
1k 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
344 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
288 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
361 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
302 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 ...
7
votes
2answers
568 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
232 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
120 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 ...
0
votes
0answers
129 views
Plot data on a map [closed]
I've a data set contains three variables: longitude, latitude, population (in USA). I need to plot these data on a map. I use the following code (it works fine):
map("state", xlim = range(lon), ylim ...
14
votes
3answers
506 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 ...
5
votes
4answers
4k 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?
5
votes
2answers
949 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
227 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
423 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 ...
5
votes
1answer
579 views
How to rasterize SpatialPolygons in R?
I'm trying to extract the bathymetry values of my area of interest from a world bathymetry raster layer using the 'rasterize' function in the {sp} package.
*Edits: I found the 'extract' function ...
6
votes
1answer
1k views
How to convert point data into a gridded dataframe for histogram analysis?
I am very new at using GIS data and only modestly experienced with R. I've been reading about how to analyze spatial data using the spatial-analyst.net PDF book, so I'm not completely lost, but I ...
