Statistical computing language and software environment.

learn more… | top users | synonyms

2
votes
3answers
77 views

How to reclassify only a part of a raster but keep the rest unchanged (ArcGIS or R)

I'm trying to reclassify only a certain part of a raster...not the entire raster. Here's the problem. I have a LULC raster of the entire US. There are some issues with the raster that I want to ...
6
votes
1answer
168 views

Help choosing most suitable bivariate choropleth mapping coloring scheme

I am trying to overlay a nominal variable (2 categories - rainfed vs irrigated) in a choropleth map over a numeric variable. In order to highlight the difference in pattern among the two ...
1
vote
1answer
88 views

Convert from eastings and northings to latitude and longitude without ArcGIS

I am not a GIS user, but I was given some shapefiles to work with. I do not have ArcGIS or any other GIS tool, but I do have Matlab with the mapping toolbox and R. From what I can tell, the data is ...
2
votes
3answers
60 views

Relative areas projection independent?

I need to calculate how much (in percent) each of thousands of spatial polygons shrink after some events. I use R and the very useful sp-library. Example: Projection: "+proj=longlat +datum=WGS84 ...
3
votes
2answers
123 views

How can I create a choropleth from the 2010 census ZCTA shapefile using R and ggplot2?

I have created state and county choropleths in R using ggplot2. The method I have used for this came from Winston Chang's "R Graphics Cookbook". For those choropleths the map was already represented ...
0
votes
1answer
36 views

linked maps not working in R

I am trying use the micromap package in R, but something is not working. This is the code: library(micromap) library(rgdal) library(ggplot2) setwd ('C:/Users/Jesus/Dropbox/linked maps/Chapter4') ...
2
votes
2answers
80 views

What is the latest version of R that supported gpclib?

Does anyone know what the latest version of R that supported the gpclib package? I was using the latest version but when I tried to install gpclib, it said that it was unable due to my version of R. ...
2
votes
1answer
48 views

R generated files getting scrambled on import in ArcGIS

I want to put this out there just in case someone somewhere has experienced similar issues. I have a .csv file that I have generated in R 3.0 using this code: ...
0
votes
0answers
36 views

Dates are off when opening netcdf file in R

I have a netcdf file with the time dimension that goes from 12/2007 until 12/2010 with monthly time steps. I can see the correct dates in both arcgis and panoply. Panoply tells me this file is a ...
2
votes
1answer
54 views

Null values coerced to zero (0) when exporting to csv or txt

I extracted values from several rasters, and in some cases, the value is null. However, when I export the attribute table to a csv or a txt file (from ArcMap), the null values are converted to 0. Is ...
0
votes
1answer
61 views

How to load Georeferenced Scanned Maps in R

I have a geo-referenced scanned Map in GeoTiff format, which I would like to load into R. My intention is to plot some vector data (points and polygons) over this map using maptools package. Is ...
0
votes
1answer
74 views

Processing HDF4 data in R

I am trying to process MODIS files in R, which are in HDF4 format (link to data). I have experience reading in HDF5 and netCDF files in R, but HDF4 seems to be a common problem in R. I am using a MAC ...
2
votes
1answer
83 views

how to extract a variable at specific time and depth from netcdf in r

I have the following netcdf file containing 7 variables and 4 dimensions. [1] "file data.nc has 4 dimensions:" [1] "depth Size: 12" [1] "time Size: 37" [1] "x Size: 305" [1] "y Size: 432" ...
2
votes
1answer
57 views

shape file for linked micromap not working

I am trying to replicate the example provided in the micromap R package of a linked map with the poverty rate for the 50 US states. I am trying to achieve the same results with a Shapefile from ...
2
votes
0answers
44 views

python equivalent of spatstat's spatial point process functions

Is there a free python package (i.e. PySAL?) that implements the standard summary statistics for spatial point processes, e.g. the F, G, J, and K functions? I'm happy to use R (i.e. spatstat) if ...
1
vote
3answers
85 views

How to access shapefile table in QGIS Modeler R scripts?

I need to develop .rsx scripts for QGIS 2.0.1 Modeler to do statistical elaborations on data tables of loaded vector layers. In this case I am not interested in accessing shapefile geometries, I'd ...
3
votes
2answers
90 views

Exporting Maps as PDFs in R

In R, trying to export choropleth maps with density and frequency histograms as legends; have had success exporting as an image but not as a pdf. Exporting as an image (.png) works well; the map, ...
1
vote
1answer
53 views

R: distance from one point to many polygons

OK so I have a spatial polygons data frame, and I have a point of interest. I want to add a row to the SPDF that contains the distance from the centroid of each polygon to this given point. How do I ...
0
votes
1answer
39 views

Units of gBuffer from rgeos package

I have this polygon: library(maptools); library(sp) setwd(system.file("shapes", package="maptools")) columbus <- readShapeSpatial("columbus.shp") proj4string(columbus) <- CRS("+proj=longlat ...
2
votes
2answers
44 views

How to extract values of one point dataset to second point dataset based on proximity using R?

I have to point shapefiles and would like to extract values from one point shapefile to another one based on some measure of proximity, i.e. for any given point in dataset x, extract the mean value ...
3
votes
1answer
50 views

plotting a SpatialPolygons object using lines() without lines connecting separate polygons

This is almost an extension of a question asked on stackoverflow (http://stackoverflow.com/questions/12196440/extract-feature-coordinates-from-spatialpolygons-and-other-sp-classes), so I'll use the ...
1
vote
1answer
84 views

Apply r.neighbours or Neighbourhood analysis (LecoS plugin for QGIS) to 3000 rasters

I need to apply r.neighbours or Neighbourhood analysis (QGIS plugin LecoS (or equivalent) to 3000 rasters and define a neighbourhood of 5 x 5 and calculate the mean. I suppose I need to create a ...
2
votes
2answers
119 views

Flow Accumulation in R

My apologies for such a general question. Is there an ArcGIS like implementation of Flow Accumulation for R? What I am trying to avoid: Using ArcGIS; Using Grass; Using RpyGEO (but will if need be) ...
1
vote
0answers
47 views

Write raster with its attribute table and symbology

I am classifying lots of rasters and I'd like to automate the legend creation and symbology displaying for easy manipulation. Here is the kind of raster I'm dealing with: library(raster) r <- ...
0
votes
1answer
74 views

Is there anyway to stack or merge .hdf files in R Studio?

I would like to be able to merge, mosaic, or stack several .hdf files. Does anyone know the package or library i should be looking for the tool to do this?
2
votes
3answers
129 views

How to get count of non-NA raster cells within polygon using R

I've been running into all sorts of issues using ArcGIS ZonalStats and thought R could be a great way. Saying that I'm fairly new to R, but got a coding background. The situation is that I have ...
5
votes
1answer
208 views

calculate {minimal} distance between polygons in R

I have calculated the surface area of species distributions (merging polygons from shapefiles), but since this area can be comprised of quite distanced polygons, I would like to calculate some measure ...
1
vote
2answers
86 views

convert data.frame with no lat-long info to a raster

coders, I need to read in a .txt file into R and later do some spatial analyses on it. I’m working in R. 3.0.2 on a Windows server. I load the following libraries (probably more than I need): ...
4
votes
1answer
77 views

Extract points from regular data.frame with coordinates based on SpatialPolygonsDataFrame in R

I have a regular data.frame called datos.merged class(datosmerged) [1] "data.frame" The last two columns are the corresponding geographical coordinates datosmerged[1,c(23,24)] XCOORD ...
1
vote
1answer
48 views

Convert point to grid: Numbers of cells differ

In R I am trying to aggregate points data to a grid. The data for the grid (G-Econ) comes as a csv-file. In this file each row represent a grid-cell at 1x1 degree resolution and the given ...
2
votes
1answer
109 views

Splitting strings into new rows, retaining geometry

UPDATED BELOW I have 9 shapefiles, each shapefile has 700,000+ rows and I have roughly 12 attribute fields in each shapefile. There are three attribute fields, common to every shapefile, that I am ...
2
votes
1answer
90 views

Access Shapefiles from PostgreSQL/Postgis in R

I successfully setup a connection to my PostgreSQL/PostGIS database on Ubuntu Server from my Laptop (Ubuntu 12.04). Therefore I installed RODBC in R to setup a connection and I made a correct entry ...
3
votes
1answer
103 views

Sample size for variogram modelling using the geoR package in R

I am trying to use the geoR package in R to model the variogram for a dataset of 15 000 sample points of bathymetry data. I intend to do a random split to create test (20%) and training samples (80% ...
2
votes
1answer
123 views

R or QGIS? Measuring elevation at points on DTM surface

Based on answers to this recent question I have been able to create natural looking digital terrain models using a combination of raster, rasterVis and rgl working on data held in ESRI ASCII grid ...
2
votes
2answers
97 views

Determine if points fall upstream or downstream from a point on a line (river)

I have a set of fish species occurrences (lat/long) as points and set of rivers as lines. The fish species can of course only occur in the rivers (and not on land). I would like to determine whether ...
3
votes
1answer
173 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 ...
0
votes
1answer
46 views

Can rgdal use an external GDAL installation?

The README for rgdal contains the following text: file.show(system.file("README", package="rgdal")) For additional drivers, users of the CRAN Windows and CRAN OSX binaries can either convert ...
1
vote
0answers
30 views

TPS and Kriging Cross-Validation

I am looking for existing package or functions that will allow me to cross-validate multiple outputs of Thin plate spline (TPS) and Kriging from the fields package. Does anyone know of any availabe ...
8
votes
3answers
169 views

R, rasterVis and RGL: how to prevent reflective surfaces?

I have been experimenting with digital terrain model files in ESRI ASCII grid raster format. Despite zero experience with this type of data I found it very easy to load into R, as per code below. The ...
5
votes
4answers
180 views

Calculating percent cover from shapefiles

I normally do not work with shapefiles, so I am a bit lost here. I have two shapefiles each with multiple objects. The first is a set of 32 polygons (each one is a plot). The second shapefile has ...
0
votes
1answer
66 views

Summarize values from a raster brick by latitude bands in R

I would like to sumarize (sum and/or mean) values from layers on a raster brick based on latitude bands (been using raster package). Been looking at the package documentation and didn't find a way to ...
2
votes
2answers
46 views

How to find the second highest value in a rasterStack in R

I have a rasterStack of rasters representing count data. I want to return a single raster whose values are the index of the raster with the second highest value for each cell. (I used which.max for ...
2
votes
1answer
66 views

Axis of rendered shape files not showing numbers that are latitude and longitude

I am using rgdal to render some shape file. The first is a set of building zones from NYC Open Data. The second is the NYC coast line from OSM. The Zone files seems to generally render an X axis ...
1
vote
0answers
57 views

Making spatial clusters by direct manipulation of raster pixel values using R

I think this is an overambitious million dollar question, but I'm always optimistic when I pose a question even though I feel like I left no stone unturned! I've processed a raster layer with pixel ...
0
votes
1answer
109 views

Scale parameter of the GetMap function within RgoogleMaps

Within the R library called "RgoogleMaps", there is a function called "GetMap" which is used to save a georeferenced image file. The library's manual suggest that the SCALE parameter supposed to be ...
1
vote
2answers
210 views

unionize intersections of merged polygons

[Updated quesion] I am using the following code to merged polygons from shapefiles for the purpose of calculating the surface area; library(maptools) library(rgdal) library(rgeos) #enter slots, ...
7
votes
3answers
193 views

R - How to sampleRandom() from large raster without NA values

I have a number of vary large rasters which need to be randomly sampled with the return value being a matrix of x, y, and value. The raster package sampleRandom(raster,n, na.rm=TRUE, xy=TRUE) will do ...
3
votes
2answers
160 views

Convert polyline shapefile to points 1m apart and add xy coords in R

I have a table with xy coordinates in R and the following packages loaded: spatstat, raster, rgdal, sp and zoo. I do know how to use this to make a point shapefile, a line shapefile that goes through ...
2
votes
2answers
159 views

Plotting a map of New Zealand with regional boundaries in R

I have been asked to make a map of New Zealand using R with regional boundaries. I need something exactly like this example of a map for Switzerland: ...
2
votes
2answers
158 views

How to use ggplot with Processing in QGIS 2.0?

I'm trying to use R scripts within QGIS thanks to Processing. There are some example scripts available and I achieved to plots different columns of the attribute table (with the plot built-in ...