Statistical computing language and software environment.

learn more… | top users | synonyms

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 ...
15
votes
2answers
5k 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 ...
7
votes
4answers
3k views

How to split a vector in equal smaller parts in QGIS or similar?

i want to divide a shapefile with many tiles into a lot of smaller tiles. I am searching for a smart solution, because manual edits are out of questions Anyone can help or know a nice function?
11
votes
6answers
990 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 ...
5
votes
1answer
1k views

Shortest distance from point to line (big dataset)

What is the best method to calculate the distance from the nearest road for a series of address points in QGIS, having a very big dataset? (QGIS 2.0.1, Win XP) I read the answers to previous similar ...
4
votes
2answers
973 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 ...
25
votes
7answers
4k views

How to compare two spatial point patterns?

If I have two point pattern distributions within the same geographic region, how would I go about visually and quantitatively comparing those two distributions? Also assume I have many points within ...
18
votes
6answers
758 views

What are sources for current geo-statistical analysis classes/events: open or proprietary

I am keenly interested in geo statistics (and many other words with 3 t's :). I am not very programatically inclined but have been following several lists with this theme. One being the R filter on ...
11
votes
2answers
3k views

Clipping a raster in R

I am building a map for the northeastern U.S.A. The map background needs to be either an altitude map or a mean annual temperature map. I have two rasters from Worldclim.org which give me these ...
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 ...
10
votes
1answer
581 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: ...
39
votes
10answers
5k views

What is the most useful spatial R trick?

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 ...
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 ...
9
votes
1answer
392 views

How do I randomly alter a 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, ...
8
votes
2answers
443 views

Creating randomly shaped clumps of cells in a raster from seeds of 1 cell/pixel?

As my title says, I wish to "grow" clumps of cells from seeds within a raster. My base raster is full of 1's and 0's, 1's indicate land and 0's sea/NA areas. From the 1's I wish to select 60 random ...
6
votes
1answer
3k views

GIS, R and shapefiles

I have some data that encodes locations in certain countries, such as the US and China, that I would like to map. The data includes location name in Latin, extended Latin and other scripts (Japanese, ...
11
votes
5answers
3k views

Get Raster Values from a Polygon Overlay in Opensource GIS Solutions

I have two layers. A polygon-shape-layer with many tiles and a raster-layer containing CORINE 2006 land cover with many categories in a colourmap. I want to obtain for each polygon in the shapelayer a ...
4
votes
2answers
640 views

QGIS affine - form of equation

I am at the mercy of a govt authority who have provided utility information in a cad format with a 0,0 origin and a nonsense grid. About a dozen files, the grid and origin are entirely arbitrary. To ...
4
votes
1answer
979 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 ...
13
votes
1answer
4k views

How to create an attractive choropleth map in R?

I've been experimenting with choropleth mapping techniques in R, having reaped the benefits of ggplot2 for creating beautiful graphs within a powerful data analysis package. When it comes to mapping ...
15
votes
4answers
13k views

How to open a Shapefile in R?

I need to open a shape file from ArcMap in R to use it for further geostatical analysis. I've converted it into ASCII text file, but in R it is recognized as data.frame. Coordinates function doesn't ...
11
votes
1answer
1k 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 ...
10
votes
3answers
3k views

Which is the best way of working with PostGIS data in R?

I work with R almost all the time, and now I am using it for doing spatial data mining, but I have this question: I have a PostGIS database with (obviously) GIS data, If I want to make statistical ...
12
votes
1answer
4k 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 ...
9
votes
1answer
3k views

Instantiating spatial polygon without using a shape file 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 ...
7
votes
1answer
1k views

Removing rows in shapefile in R

I've imported a shapefile into R, and joined it to a table. My shapefile contains all the census ids, while my table only contains selected census ids. I'm now trying delete all the rows didn't get a ...
11
votes
1answer
2k views

Using R with ArcGIS Desktop

In response to comments below, a re-phrasing of the question. I've used the integration of R with QGIS, and found it a very uesful tool. Having taken a look at the R toolbox extension for 9 and the ...
7
votes
4answers
1k views

Overlay a spatial polygon with a grid and check in which grid element specific coordinates are located

How can one use R to split a shape file in 200 meter squares/sub-polygons, plot this grid (incl. ID numbers for each square) over the original map below, and evaluate in which square specific ...
7
votes
1answer
5k 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') # ...
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 ...
6
votes
2answers
2k views

How to extract values from rasters at location of points in R?

My question is about extracting values from rasters at the location of points. With the function extract this is very easy, and the function gives me a dataframe with the values of all the variables ...
6
votes
2answers
1k 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 ...
7
votes
4answers
13k 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?
7
votes
3answers
587 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 ...
5
votes
2answers
1k views

How to implement bivariate Ripley's K function in ArcGIS 10?

The attached image shows a forest gap with red pine represented as circles and white pine represented as crosses. I am interested in determining if there is a positive or negative association between ...
3
votes
1answer
297 views

remove land area from marine region polygons

In my pursuit to merge multiple polygons for the purpose of calculating the surface area of marine species distributions, using shapefiles from Marineregions, I am now trying to remove potential land ...
2
votes
2answers
84 views

Join CSV file to shapefile

I wanted to join a CSV file to a shapefile. When I identified a field to facilitate the join, e.g., map <- spChFIDs(map, as.character(map$ID)) it returned Error in spChFIDs(SP, x) : ...
0
votes
3answers
162 views

Import shapefiles on my postgis table using R

Using R, I would like to import shapefiles that are in a directory on a geometric table i have on postgresql / postgis. What is the instruction that allows me to do it? EDIT: here is my code to ...
5
votes
4answers
4k 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 ...
4
votes
2answers
555 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 ...
4
votes
3answers
1k views

How can I find out how to convert this point to lat lon?

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 ...
1
vote
0answers
73 views

Performing Moran Test using R? [closed]

I’m very new to R so please Bear with me: I have a set of data containing AREA Infested for each region ! and I want to know if there are any spatial autocorrelation between the regions! Here a sample ...
0
votes
2answers
129 views

How can I fix a geoTiff with an incorrect CRS?

Trying to load and plot a raster (it's a DEM) in R, but having problems. Using R I read in a raster file: library(raster) dem <- raster("DEM_Victoria.tif") # >70 MB print(dem) class ...
23
votes
6answers
7k views

Tutorials to handle spatial data in R

Does anyone know some good tutorials to handle spatial data in R? I know that there are some packages like rgdal and maptools but I haven't actually found usefull tutorials to get in touch with the ...
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 ...
14
votes
3answers
505 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. ...
14
votes
3answers
609 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
1answer
1k views

use proj4 to specify Robinson projection with R ggmap and ggplot2 packages?

I want to project this map in robinson projection: library(ggmap) world <- map_data("world") ggplot() + geom_path(data = world, aes(long, lat, group = group)) ...
13
votes
4answers
6k views

How to cluster spatial data in R?

I am very new to R, so please bear with me : > 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 ...
10
votes
1answer
4k 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 ...