Statistical computing language and software environment.

learn more… | top users | synonyms

2
votes
1answer
172 views

How to work with flt & hdr files

I have been working on a vector-based spatial analysis in R using shapefiles. I wish to use some environmental data that is downloadable, however it is only available in raster format (FLT & HDR ...
0
votes
0answers
170 views

R program and shape files

I have an R program that sketched a country. This is done by reading a shape file that contains the coordinate of a country (latitude and longitude). How do I export the data from shape file into ...
1
vote
0answers
43 views

How to load or query data directly to R from a PostGIS database using RPostgreSQL and rgdal [duplicate]

Is it possible to load/query a shapefile to R, which is stored in a postgres/postgis database? I've built up a connection to my postgres database via DBI, RPostgreSQL and I want to make some ...
1
vote
1answer
106 views

Find all census tracts N miles from a lat, lon point

Using R, I'd like to find all census tracts within a given distance of a point (lon,lat). i.e. All census tracts within 20 miles of 34.0522, 118.2428 I have used the sp library and over command to ...
2
votes
1answer
506 views

Population density map

I have California population density data from from the U.S. Census in an Excel file. The spatial information is provided in ZIP Code Tabulation Areas (ZCTAs). How do I plot a population density map ...
0
votes
1answer
142 views

Saving geotiff in R - why resolution on x and y is not the same?

I have some data and i want to save it as a geotiff in R. This is not a problem but even if in my command line i set the resolution on x as 1 and on y as 1 after the geotiff is generated the ...
1
vote
1answer
119 views

Retrieving the proportion of specific pixel class from CHM rasters

CHM = canopy height model I am very new to R (specially for GIS purposes) and I am struggling a bit in getting the following pixel statistics: Proportion of zero value pixels = [nº of zero value ...
4
votes
1answer
478 views

How to split a polygon using R

I have an irregular polygon which is a spatial object. I want to divide it into multiple polygons (say, n=25) with equal height. To show how I want to divide it, I've plotted grids on the ...
4
votes
1answer
263 views

Moving window regression (MWR) in R

I'm looking for some package in R to estimate the value of a variable by moving window regression. I have read in Local Models for Spatial Analysis, which is a good method to predict values ​​at ...
2
votes
2answers
460 views

Using Regression Trees in ArcGIS

Hi I have a follow up question to this post: Statistical analyses for survey against raster? I have a very similar problem as the initial poster David. I am creating a multivariate model from ...
4
votes
0answers
417 views

Using stat_density2d with coord_map in ggplot2

In my example I am plotting a shapefile for all England & Wales, however I'm interested in the greater London area. If I allow ggplot to simply default and display the entire shapefile then the ...
1
vote
0answers
142 views

How to import binary arcgis maps into R

I have imported arcgis rasters into R. The rasters are binary maps and the legend in arcgis shows this to be binary as the colors are only 0 and 1. Now, when I import the raster into R it is no ...
3
votes
1answer
401 views

How do I create a heatmap in ggplot?

I'm using R with ggplot2 to generate maps from shapefiles and from data in SQL Server. I'm trying to get to a stage where I can automate a large chunk of the mapping I do. So far this is working well ...
0
votes
0answers
228 views

US MAP using Zipcode in R [closed]

I have a set of US zip codes grouped into two groups. I'm plotting those two groups on US MAP using R code. I'm using following code to plot group A & B combining together ...
2
votes
1answer
503 views

combine raster and polygon values in R

My question is similar to this one Get Raster Values from a Polygon Overlay in Opensource GIS Solutions but I think I need another step. I have a polygon layer of ecoregions which I brought into R ...
4
votes
1answer
391 views

Replace NA's with 0 for raster data using R

I am new in R. How can I replace NA's with 0 for my raster data which have spatial information?
7
votes
3answers
226 views

How to compare spatial patterns (crime cases vs population)?

I am looking for a way to statistically compare two spatial patterns in shape polygon data (not point pattern analysis). Let's say I have a city map divided in neighborhoods (barrios), in shape ...
3
votes
0answers
112 views

Can extracting raster values work in polygons' CRS without raster resampling?

I am trying to extract raster values using polygon layer with different CRS. Raster is in WGS84 (EPSG:4326) and the polygons in UTM (EPSG:23031). 1. If I want to work in the projection of the ...
0
votes
4answers
201 views

Buffer in QGIS/R is 650-670 m wide instead of 500 m

I am trying to make a 500 m buffer for my polyline layer. Unexpectedly, I receive buffer varying from 650 to 670 m, depending on location. As many resources recommend to use UTM before making a ...
1
vote
1answer
103 views

Union of polygons doesn't work 100 % correctly

I'm using the function gUnaryUnion to merge polygons in R. In one particuliar case this doesn't work correctly - some of the old polygon contours are still visible: Can anybody help ?
3
votes
0answers
176 views

Is co kriging appropriate for interpolation of three spatial co variates?

I want to estimate an interpolation model(s) for daily minimum temperature, daily maximum temperature and daily rainfall. I have samples of approximately the same size for all three variables at ...
2
votes
1answer
257 views

Bubble Plots in R not displaying

I was attempting to follow a tutorial to create a bubble plot of school district proficiency rates. Data shapefile of school districts (Census2010.shp) ...
1
vote
0answers
234 views

Ordinary kriging with three dimensions in R

I want to interpolate temperature for a surface defined by three coordinates: longitude, latitude and altitude. I know one option is to use universal kriging on two dimensions and use altitude as a ...
-1
votes
1answer
352 views

WinBUGs giving 'Illegal memory write error' running under wine [closed]

Ok some I am trying to use Winbugs to do spatial smoothing. I am running r code in R study and using R2WinBUGS to call Wine 1.4 under Mac OSx Mountain Lion. It works ok for some models but for the CAR ...
0
votes
0answers
83 views

Why does a shapfile shift after transformation?

I have a shapefile created in the raster package (ER_14.3_2000_poly). > #read in a raster file > ER_14.3_2000<-raster('E:/Ecoregions Models/Outputs/ER_14.3/ER_14.3_ConsensusMap3.asc') > ...
4
votes
0answers
166 views

How to build Poisson autoregression model

I have a SpatialPolygonsDataFrame object in R with about 3000 polygons and associated data. I have columns of expected and observed cases. For the moment, I don't have any covariates. I'd like to ...
2
votes
1answer
121 views

Several algorithms done for topographic correction => black spots - how to solve?

I have done several algorithms for topographic correction in R including simple cosine, Minnaert, SCS. The input data aspect and slope for the hillshade raster have correctly been done in radians. The ...
2
votes
0answers
217 views

R, GeoJSON and Leaflet

I recently learned about leafletjs.com from an R-Bloggers.com post. One such tutorial that I would like to achieve is to create interactive choropleth maps with leaflet. I have been using the rjson ...
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 ...
1
vote
1answer
403 views

How to save R raster plot for ArcGIS raster file

I want to save my raster plot that produced with R to ArcGIS raster (.img, .tif and ASCII) file.
3
votes
1answer
177 views

Fix Labels United States Map Help R, R-Studio?

Does anyone know how to deal with the labels that do not fit within a states boarders? I need the labels on the east coast to be moved outside of the state and a line drawn pointing to the ...
3
votes
2answers
709 views

Add Numbers to United States Map Help R, R-Studio?

Can someone help me with creating a map in R? I need to make a map of the number of retail stores a company has in each state. All I need is the store count displayed in each state. For example: ...
3
votes
1answer
974 views

Setting extent and geographic projection in R

I have a raster and a shapefile that I am attempting to view and process in R. The shape file "ER_11.1" has the following specs: > ER_11.1 class : SpatialPolygonsDataFrame nfeatures : 22 ...
2
votes
1answer
416 views

extracting data from rasters using shapefile boundaries in r

I have a raster.stack of 8 environmental variables and a shapefile of Ecoregions for the southern U.S. files<-list.files(path='E:/Ecoregions Models/Border Bioclim/',pattern='asc', ...
2
votes
2answers
2k views

Choosing the correct value for proj4string for shape file reading in R “MapTools”

I am having a shape file of polygons and another CSV file which contains a list of points as (Lat, Lng) pairs.. I want to check for each (lat, lng) pair from the CSV file which polygon does it fall ...
4
votes
1answer
209 views

Clip polygon and retain data

I have these two polygons: library(sp); library(rgeos); library(maptools) coords1 <- matrix(c(-1.841960, -1.823464, -1.838623, -1.841960, 55.663696, 55.659178, 55.650841, ...
2
votes
2answers
821 views

Checking if Lng and Lat fall inside polygons from ESRI Shape file

I have two input files. First: CSV file with a list of points each defined with Lng, Lat, Name Second: ESRI Shape file defining a number of polygons I would like to determine for each point I have ...
2
votes
1answer
272 views

LSA-SAF data reprojection with GDAL and R

The Land Surface Analysis Satellite Applications Facility (LSA SAF) distributes several products derived from the EUMETSAT satellites data. I am working with R to read and process the data (the file ...
1
vote
1answer
275 views

Overlay points over gadm map

This is a crosspost with stackowerflow and I hope for understanding and that it will no be closed as it concerns both cartography and R. I have already asked about plotting points dependent on ...
3
votes
0answers
294 views

Novel ways of filling in missing values in a raster

I am looking for robust ways to fill in missing values in some rasters. They all have a single layer. Missing values consist of single pixels to medium sized patches. Rasters are around 1000 x 1000 ...
3
votes
1answer
446 views

Find clusters of points based distance rule [duplicate]

I have some points that I need to divide into groups based on clusters of points: x <- c(-1.482156, -1.482318, -1.482129, -1.482880, -1.485735, -1.485770, -1.485913, -1.484275, -1.485866) y <- ...
1
vote
1answer
107 views

r raster package rasterize failing:no slots

I'm having trouble rasterizing a shapefile using the raster package in R. shp<-shapefile(ZoneShape); lcRas<-raster(lcRaster); r<-raster(ncol=ncol(lcRas), nrow=nrow(lcRas), crs=CRS); ...
2
votes
1answer
180 views

Convert lat/long four corners data to raster

I have a data set in the following format.each row represents the coordinates of the four corners of a cell and the last column is the value associated to the cell. lon1 lat1 lon2 lat2 lon3 lat3 lon4 ...
2
votes
0answers
117 views

Plot points map of population [closed]

I want to plot kind of isarhytmoc points map like in this tutorial, but with population data. However, unfortunately, I have no enough skill and only came with such code: require(sp) require(rgdal) ...
1
vote
2answers
178 views

How to modify the results of a geological dataset from vertical to horizontal?

I have a 3-D point shapefile of a geological fault dataset consisting of x,y, and z columns. I need to create a raster dataset from this point dataset. I have been trying to do this in ArcGIS; ...
2
votes
1answer
640 views

Correlation between rasters using R

In R, anyone know a method for measuring correlation between raster and spatialpixels, or between two rasters?. I read something about Kulldorff but do not understand how to use it, and maybe it's not ...
0
votes
1answer
209 views

How to shift polygons by updating their details in R

I have two polygon shapefiles and I want to see to what extent the observed amount of overlap is due to chance. I'd like to randomly move the polygons in one shapefile to new locations, measure the ...
-3
votes
3answers
857 views

How to add a field to a shapefile using R

This question is trying to make sense of a post that already exists that looks good, but is failing in practice. The second ranked answer uses the foreign package to read a shapefile attribute table ...
2
votes
2answers
1k views

Setting “R Folder” Path in QGIS Sextante

I have installed R via the R-Project website. I have QGIS installed via OSGEO4W (currently 1.9.0 Master), and have Sextante plugin installed and working with GRASS and SAGA providers. I am now trying ...
4
votes
1answer
573 views

Zonal Statistics for Polygons with R

I'd like to do zonal statistics / terrain analysis with polygon overlays - I achieved to get min / max like so: library(raster) library(rgdal) alt <- getData('alt', country = "AT") gadm <- ...