Statistical computing language and software environment.

learn more… | top users | synonyms

1
vote
2answers
366 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 ...
3
votes
1answer
66 views

Projection mismatch when plotting precipitation with ggplot

I'm trying to plot accumulated precipitation in Brazil for a given period, see code below: Load packages library(raincpc) library(SDMTools) library(raster) library(ggplot2) library(rgdal) ...
2
votes
0answers
42 views

R: Can raster predict function pass to predict.rfsrc (a prediction function in a parallel verion of RandomForest)?

It seems that raster predict function can pass to predict.randomForest by setting the "type='response'". I am using a parallel version of randomForest package called the "randomForestSRC" and I am ...
1
vote
1answer
25 views

R SP library: identicalCRS and parameters in different order

The following returns FALSE: library(sp) points <- matrix(rnorm(30, 50, 10), ncol=2) proj1 <- CRS("+proj=utm +zone=10 +datum=WGS84 +ellps=WGS84 +units=m +no_defs +towgs84=0,0,0") proj2 <- ...
3
votes
0answers
36 views

Spatial interpolation with breaklines in R

I have a dataset consisting of irregularly-spaced points (x,y,value) that represent an area of ocean that contains some land. I need to interpolate these to a regular grid, ensuring that the ...
1
vote
0answers
32 views

R{raster} getValues(): error accessing values of large raster

I am getting the following, while extracting all values with: rs<-getValues(rster) Error in getRasterData(con, offset = offs, region.dim = reg, band = object at data@band): long vectors not ...
0
votes
2answers
37 views

How to find variable names for SF1 Census files

I'm trying to to read the 2010 Census data so that I can link some of my research data to geographic information. Ideally I would like to use census tract data and other covariates. I've downloaded ...
5
votes
4answers
1k views

Create a ground overlay kml from georeferenced raster

I have a world georeferenced raster (5m resolution, ~4000 x 4000 pixels) that I would like to display in google earth. I am looking for a simple and effective way to generate this kml file. Using ...
1
vote
1answer
62 views

How to analyse point data as covariate for areal data

I have two data sets: a) a set of polygons with areal data variables. b) point measures of various co-variates of interest (note I do not necessarily have a point for each polygon) How do I ...
14
votes
2answers
3k views

Using R to calculate the area of multiple polygons on a map that intersect with another overlaid polygon

I have a shapefile downloaded from the Ordnance Survey that gives electoral ward (division) boundaries for a county of the United Kingdom. I have successfully used R to load the shapefile and plotted ...
1
vote
2answers
556 views

How to access each raster in a stack with a loop

I have a stack of rasters and I want to access each layer, combine each later with another file and finally export the resulting file as a csv file. Is there any way to do this with a loop? So far I ...
1
vote
1answer
76 views

Is there a way to write single bands raster from multi-band layer faster in r?

I have 1000 multi-layer rasters and have to export each separate layer to a tif. Some friends recommended R to do the job. I used the following code: library(raster) namesVector<- c("layer1", ...
4
votes
1answer
80 views

How to mosaic rasters in R?

I am trying to mosaic several rasters into single big raster in R. Using script that posted in http://stackoverflow.com/questions/15287807/how-can-i-create-raster-mosaic-using-list-of-rasters But, I ...
1
vote
0answers
51 views

How do I convert a .bil (and associated .clr, .blw, .hdr, and .stx) files into georeferenced rasters in R? OR to geotiffs using gdal_translate?

The title says it all. I've got a bunch of .bil files, which I can open in R using the raster command pointed to the path to the .bil file. But I don't know how to efficiently incorporate the ...
2
votes
1answer
121 views

Wrong projection high quality shapefile for the coastline of Helsinki region (Finland)

I did some spatial interpolations in R and I need a support for those. Looking for shapefiles online the best I could find was and it looks really horrible, the same area in ggplot looks like . I ...
3
votes
1answer
65 views

Map accuracy assessment by moving window in R

I would like to make an accuracy assessment using a confusion matrix between classified Landsat image and reference dataset. Maps have the same resolution and extent. I would like to evaluate the ...
0
votes
0answers
13 views

plot shp files like pnm? (Statistical Data Analysis Explained example) [duplicate]

Weird subject? well I'm confused so in advance: sorry for this wavy question: I'm trying to do what the authors of Statistical Data Analysis Explained (ISBN: 978-0-470-98581-6) have done in figure ...
1
vote
2answers
82 views

2 shape files plots together in a GIS, but not in R

I tried plotting these two files and a set of points (dropbox folder) in QGIS and MapInfo. They align pretty good (not perfect though). But in R, only the data from www.naturalearthdata.com can plot ...
6
votes
1answer
67 views

Simplest way to limit the memory that the raster package uses in R

What's the easiest way to limit the memory the raster package uses in R to 5GB of RAM? Ideally I want any raster that exceeds this size to be written to the hard drive and analysed from a temporary ...
0
votes
0answers
43 views

MapInfo “shape” file vs. naturalearthdata.com shape file

When i load this map shape file (exported from MapInfo as a shape file) shp.WashingtonLand<-readOGR("C:\\...\\Maps","WLmap2_polyline") R replies: OGR data source with driver: ESRI Shapefile ...
0
votes
1answer
153 views

Trilateration algorithm for n amount of points in R?

I read the page Trilateration algorithm for n amount of points and I have to do similar kind of trilateration in R. I am not that expert in R, can anyone help, if there is similar function/package ...
0
votes
0answers
40 views

Calculating tortuosity

I have the geographic locations of a species of fish over a period of time but want to assess how complex its movement path was. How do you calculate fractal tortuosity, or tortuosity via other ...
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 ...
1
vote
1answer
93 views

plotting a map of north greenland in R

My knowledge in GIS and R is again tested when I want to map a small part of northern Greenland (called Washington Land) in R (and plot analysis data on top later). I've managed to plot it with ...
1
vote
1answer
31 views

Remove points within x distance

I have these spatial points: long <- c(-1.769717, -1.767766, -1.769170, -1.768462, -1.768389) lat <- c(54.92214, 54.92207, 54.92113, 54.92167, 54.92165) points <- data.frame(long, lat) ...
0
votes
0answers
86 views

R plot raster with real colors

I'have a raster image from Scran25 IGN. In Qgis, it opens perfectly but in R (with rgdal or raster packages), I do not know how to keep the original colors like this exemple? I have tried ...
0
votes
0answers
37 views

Chloropeth Map in R, Data on map not represented as in listed in the file

Below is the code for creating the Chloropeth Maps, once created, the actual problem is that the heat intensity indicated by the map is not according to the dataset column called value mentioned in ...
4
votes
1answer
212 views

Loading a multipoint shapefile in R

This issue has only been raised in the community once, two years ago, to the best of my knowledge. I think it's high time to raise the issue again! readOGR, from the rgdal package, cannot handle ...
1
vote
1answer
46 views

assigning census block demographics to postal data (zip/zip+4)

Using Python and R, what would be the best strategy to tie Census Block-level data to zip/zip + 4? I understand we're not matching polygon boundaries (zip codes are not geographies), but somehow ...
0
votes
1answer
67 views

How to do supervised image classification in saga with the help of R script or Python script

I am using Ubuntu 12.04 and want to do image classification in SAGA. SAGA has numerous classification algorithms which is not present in GRASS and QGIS. I am new to SAGA, but more accustomed to work ...
0
votes
2answers
85 views

Error in which.max() : not yet implemented for large objects in R

I am going to create raster by Julian day that observed maximum value of NDVI within a single year. Actually, I want to know which julian day (or raster) has max value in each cells and get result by ...
0
votes
2answers
82 views

How to create raster map by day that observed maximum NDVI from multiple raster data in R?

I have 11 NDVI raster data, representing single summer. I want to create raster by day (Julian day or name of raster) that observed maximum value. In other words, I want to know which day (which ...
2
votes
1answer
132 views

Interpolation with netcdf4 file

I have a netcdf4 data set that contains array and information about latitude and longitude which can be accessed with the following R command: ncvar_get(dataname, 'lon'); ncvar_get(dataname, 'lat'); ...
1
vote
1answer
52 views

Alternatives to bilinear interpolation for raster extraction in R

I have a set of coordinates for which I want to extract temperature values from a raster. I am using the extract function from the raster library in R. Looking at the interpolation methods, there are ...
0
votes
1answer
27 views

Overlaid raster gets shifted around when printing to pdf or when resizing graphics device with mouse

I've spent the past couple of days learning how to use the maps, raster, and rgdal packages to create nice images, but I'm running into trouble when trying to make pdf's for actually presenting. I'm ...
0
votes
2answers
57 views

Is it permissible to redefine raster resolution (not resample!) in order that it be included in a SDM?

I'm fitting a SDM using R. A requirement is that all environmental predictor layers have the same extent, origin and resolution. I have high resolution bathymetry data (25m) that I will resample to ...
3
votes
1answer
108 views

Spatial Classification

I am not sure what to call my problem. From this image, I have a set of classified polygons (colored). I would like a way to classify the white polygons in the image. I don’t have any attributes to ...
1
vote
1answer
115 views

Color region polygons according to cluster label

I want to present data on a map of our country. I have used R for showing the clusters on a country! Here the steps I took: setwd('D:/r/cluster2') channel <- odbcConnectExcel('cluster.xls') data ...
2
votes
3answers
109 views

How to analyze and combine overlaping elevation maps into one?

I have 30 overlapping maps that contain tree density heights (measures between 1-100%) of a large area, and I need to get the highest point by pixel and create a new map with all these highest points ...
0
votes
1answer
34 views

Creating a loop for Lines data (spatial data)

I am trying to build a lines shapefile with the contour lines from the 20 meters isobath from along the East African coast. This contour line of 20 meters has different segments and I have this ...
4
votes
2answers
133 views

join grid or polygon layers in R

I have two grids. Cells in each grid have an attribute. Size of grid cells differs between the two grids and the two grids do not overlay each other perfectly. I would like to create a new layer, ...
1
vote
1answer
54 views

Bounding geo points

I am kinda new to geo data processing. For my sample project I am trying to solve next problem. I have array of geo points. If we place it on plot we can visually see that there are areas where ...
1
vote
0answers
53 views

Display followers count on Google maps using R

How can I plot the count of followers, locations wise on google maps - Im using R language my data is as below: for(i in 1:25){print(friends_obj[[i]]$location)} [1] "London & Glasgow/Edinburgh, ...
0
votes
0answers
20 views

Overlay Shapefile and Raster layer in R [duplicate]

I have a raster layer with climate data from the north of Mexico, part of Canada and the US mainland. I am trying to restrict the climate data to only the zone of the US mainland. To do this I thought ...
2
votes
0answers
91 views

Three-dimensional interpolation of temperature profiles using gstat in R?

I'm working on a problem in which I'd like to interpolate a set of oceanographic temperature profiles over a three-dimensional matrix of unsampled x, y, & z locations. The data to interpolate is ...
0
votes
1answer
88 views

How can I take a large netcdf and convert it to interpolated values in a different set of coordinates?

I've got a large netcdf (a small portion of the data is here) with the data in an even grid associated with an Albers Equal Area Conic projection. I've got the corresponding latitudes and longitudes ...
1
vote
1answer
123 views

Interpreting Moran's I results

I have a sample of data taken from regions of a country! i want to test if there are any spatial autocorrelation on my data using Moran Indice test. the null hypothesis: is that there is no spatial ...
0
votes
0answers
14 views

Plotting two shapefiles using R? [duplicate]

I'm not familiar with using R for GIS. I was wondering if you can help me figure out how to plot different shapefiles at the same time. I'm using the "map" function to generate a map in order to get ...
2
votes
1answer
35 views

R - Occasional error when using alphahull package areaahull() function

I've recently started using the fantastic alphahull R package, which works beautifully most of the time but occasionally I am getting the following error when running the areaahull() function: Error ...
11
votes
2answers
2k views

How to efficiently read a kml file into R

Hi I'm working with huge .kml files (up to 10 Gb) and need an efficient way to read them into R. Until now I've been converting them to shapefiles via QGIS and then back into R with readShapePoly and ...