Statistical computing language and software environment.

learn more… | top users | synonyms

0
votes
1answer
33 views

Defining the correct AEA proj4string for FEWSnet Rainfall Data (Southern Africa) in R [closed]

I have some general questions about how to go about solving this problem: I am trying to incorporate FEWSnet's monthly Rainfall Estimate data from 2014-2015 for Southern Africa into an analysis where ...
2
votes
0answers
36 views

Keys for merging US state/county ANSI's with GADM Unique identifiers?

I've got county-level data from USDA NASS, and I want to merge it with gridded climate data. A preliminary step is the associate the counties with the coordinates of their centroids. If I merge by ...
1
vote
2answers
138 views

R: aggregate raster with 'mode' function - how does it work?

I want to aggregate a very fine resolution raster at various coarser resolutions (that represents many 1000s of categorical polygons). The aggregate{raster} function is what i've traditionally used, ...
0
votes
1answer
29 views

Masking low quality raster with polygons in R gives weird overhang?

I am pretty new to R, and have been attempting to use the mask function on a raster image of 250mx250m resolution. My problem is that for some reason I am getting overhang, as there are pixels which ...
1
vote
1answer
89 views

How to get latitude and longitude data from the borders of a state in R

Here is my problem: I need to get longitude and latitude data from the borders of the Brazilian states. With this data I can plot a map of each Brazilian state and, of course, of the whole country. I ...
7
votes
4answers
272 views

How to compute max and min coordinates for multiple polygons?

I would like to calculate the maximum, median and minimum latidudinal coordinates for a large set of polygons, using QGIS or R. So the highest and lowest points reached by each polygon across a ...
1
vote
1answer
67 views

Map with ggplot2 and bubbles

I've tried to plot a map of magnitude earthquakes in Colombia with ggplot. After many efforts, I got it. But, I need to focus in specially area where the data of magnitudes is (4, 4.1, 4.2, 4.3, ...
0
votes
1answer
60 views

compare three rasters and three conditions with overlay in r

I'm trying to run an overlay function with rasters where I want to meet all of 3 different conditions at each cell and produce a single raster as output. Running ifelse with the & operator ...
1
vote
2answers
99 views

Embed a (saved) Leaflet map in an Ioslides presentation

I'm building some fairly complex maps with the leaflet package and I'd like to embed them in an rmarkdown document (specifically an ioslides_presentation .Rmd file). Right now the code for the maps ...
6
votes
2answers
301 views

How to join a table to a shapefile with non-matching IDs and names (similar strings)?

I'm having an annoying problem that I'm trying to find an automated solution for. The shorthand version is that I have a shapefile and a table of created data for regions within countries. The created ...
1
vote
1answer
38 views

Integrating ArcMap 10.1 Toolbox Model in R?

I have 30,000 raster files that needs to go through a small ArcMap 10.1 Toolbox Model I made (clip, flip, export to ASCII, etc.). I have a R script which then imports all the exported raster file and ...
4
votes
1answer
67 views

Predict/estimate point values for unsurveyed areas based on vegetation type

I have point data from deer surveys and would like to predict values for areas not surveyed based on vegetation type (Grass, Disturbed, Oak, Pine, Mixed etc.) So far I have dissolved my vegetation ...
4
votes
2answers
69 views

Accessing the Quality Band for MCD12Q1 with MODISTools GetBands

I am using MODISTools (https://github.com/seantuck12/MODISTools) to process MCD12Q1 data, which, according to the LP DAAC website ...
1
vote
0answers
38 views

Extracting data of two overlapping rasters

I am trying extract the data of two overlapping set of rasters (one, a stack of 35 rasters, all from the same source and the second an elevation raster) to get a data.frame of the values (mean of the ...
4
votes
1answer
92 views

Remove sliver gaps between polygons with R

Is there a way to eliminate the small "slivers" between polygons using R? The desired solution would create a new SpatialPolygonsDataFrame where the shared boundaries between polygons are coincident. ...
2
votes
0answers
66 views

How to pull a shapefile into R from PostGIS database (in Windows)?

I'm currently working on pulling data from a PostGIS database for the first time to map in R and need some help. The database contains a shapefile of countries/regions of the world. I am able to pull ...
2
votes
1answer
38 views

Error when trying to subset a vector to a dataframe

I'm not sure if I've used the correct terminology in my title, so please forgive me if that doesn't entirely make sense. For the sake of reproducing my example, I've created a dummy example. As ...
2
votes
0answers
138 views

In R: Convert from WGS84 lat/long to UTM and back again to WGS84 lat/long

I am looking for a way in R to project WGS84 latitudes and longitudes to a UTM grid and then convert the UTM coordinates back to the WGS84 latitudes and longitudes. I have found a number of ways to ...
4
votes
1answer
127 views

strange output from RSAGA topographic wetness index

I am trying to generate a topographic wetness index raster with the RSAGA package in R. The output I am able to generate does not make sense to me, as it has a large number of NA cells and I wonder if ...
2
votes
1answer
80 views

Plot attribute of shapefile with R

Does anybody know how to plot any attribute of a shapefile with R? For example, like this.
2
votes
1answer
71 views

How to rasterize an object of class SpatialPolygonsDataframe in R

When I read a polygon shapefile into R using rgdal, it was imported as an object of class SpatialPolygonsDataframe. I need to rasterize the polygon, but the rasterize{raster} function requires it to ...
2
votes
0answers
68 views

Doing spatial regression using big data when Spatial weight matrix is too large for R?

I am currently doing an analysis on a quite huge data set - 250,000 polygons. I have figured out the general Moran's I for a linear model, but when I was trying to do a spatial lag or spatial error ...
5
votes
0answers
167 views

How to display wind data in R with the leaflet package

I have some data like this : longitude latitude speed direction 1 6.10722222 46.23639 4 360 2 6.95416667 43.54694 4 360 3 7.21472222 43.66556 ...
2
votes
1answer
70 views

Round() does not return an integer raster in R

I want to convert the datatype of a raster to integer. For example: x <- raster(nrow=10,ncol=10) its datatype is float dataType(x) [1] "FLT4S" then I round the pixel values of x by y <- ...
2
votes
1answer
102 views

Trouble adding proportional circles on top of symbolized polygon in ggplot2 map

Data: Zipped ea.ml1 shapefile can be found here, and the country outline can be downloaded here at the GADM site. I've been using the Ethiopia ESRI shapefile. Branch locations are here. Per the ...
1
vote
0answers
77 views

Automatically filling contours by different type of hatching?

I applied a question a few days ago here Filling contour levels with grain (texture) using Leaflet, I still found no answer I try to well exposed the problem here again in another way. if we have a ...
1
vote
1answer
140 views

How to create custom discrete color scheme for polygon attributes in ggplot2?

Back again with more questions. :) Data: Zipped ea.ml1 shapefile can be found here, and the country outline can be downloaded here at the GADM site. I've been using the Ethiopia ESRI shapefile. As ...
1
vote
2answers
77 views

Vector to raster conversion [solved]

I'm using GRASS but, in case, I'm also familiar with R and QGIS. I'm trying to convert a vector area map into a raster one. My problem is that the resolution of the raster is too low (and I can't ...
4
votes
2answers
78 views

Add a point on a spplot in R

I have to add a point on a existing spplot in R. I need it only for a visual purpose. I have the coordinates of the point, but I don't know how to change the code in order to add the point. This is ...
0
votes
0answers
25 views

A vector object not being replaced in temp folder when using 'for' loop in R

I am currently running GRASS GIS through R interface and got stuck at this point; where I am using a 'for' loop in R, and the code is as follows: for(i in 1:nrow(Snapped_SSP_DSN)) { ...
1
vote
0answers
127 views

Visualizing shapefiles on web using SHINY package of R with PostGIS?

I am using PostGIS database to store my shapefiles. Now I want to read those files through shiny package of R. How can I visualize those files on web using shiny package of R and perform statistical ...
1
vote
2answers
79 views

Error Trying to Run R Summary Statistics in QGIS 2.12.1

When I try to run the R script "Summary statistics" in QGIS 2.12.1 on a Windows 7/64 bit machine, I get the error message "error in if (!file.info(DSN)$isdir) DSN missing value where TRUE/FALSE ...
4
votes
2answers
77 views

How can I calculate flow length in QGiS/GRASS?

I have these rasters: DEM Flow Direction Flow Accumulation I would like to calculate the flow distance of every pixel to the outlet of a basin. In Arc-GIS, I can use the flow length. But I don't ...
1
vote
1answer
78 views

How to find the cell location index of a raster using Lat long information?

I have a raster for which I want to find the Cell Location (Row, Col) if I have the Lat-long information. I know how to get the value of a particular cell using lat long. ...
4
votes
1answer
73 views

Buffer from Point or Polygon with Information from Raster

The intent of this work is to define a buffer around a point or polygon based on information from a raster. For instance if a polygon representing a city and the raster defines how long it takes to ...
0
votes
0answers
50 views

Clipping raster without create new table in PostGIS?

I'm learning about PostGIS, and I would like to create a SQL to cut a raster with a shapefile to work in my R program. I managed creating a new table, but I would like build it without a new table. ...
3
votes
1answer
92 views

R: extract values from raster stack and aggregate results

I'd like to extract values from a rasterstack, cell by cell, and create a list of the values: ext <- extent(0,100,0,100) r1 <- raster(nrows=100, ncols=100,ext) r1[] <- sample(seq(from = 1, ...
2
votes
1answer
348 views

Filling contour levels with grain (texture) using Leaflet

I created a program to draw temperature contour map of France: This is the code: library(ggplot2) library(gstat) library(sp) library(maptools) require(rgeos) library(rgdal) library(foreign) ...
1
vote
1answer
60 views

Clipping raster objects in PostGIS

I'm trying to cutting a raster object (from a PostGIS table) using a shapefile with reference, extracting raster data from a polygon area. My objective to work with the clipping raster into R. I'm ...
1
vote
1answer
142 views

How to read file geodatabase with Binary field in R?

Short version: how can I get into R the dataset available at this link? (you need to log in to download, but registration is free) The dataset that is downloadable at that link expands to a ...
3
votes
0answers
163 views

Using R to map matching GPS data? [closed]

I have many vehicles GPS data points, which consist of "timestamp, longitude, latitude, fuel consumption and distance" and the data is OSM(open street map) based. I want to match the data points to ...
0
votes
0answers
18 views

How to find mean and standard deviation of MCAR model using mcmc methods

I perform analysis of spatial data with MCAR model and I use spbayes package, the problem what I find is how to find 1.mean and standard deviation of the model.and then make the histogram of mean and ...
3
votes
3answers
317 views

How do I plot points as graduated/proportional circles in R?

I'm back again with more R mapping questions! This one is concerning symbolizing points by a certain attribute with graduated/proportional circles. DATA: My full code can be found here if you're ...
0
votes
1answer
105 views

When aggregating points by polygons with sp::over function, how do I include attribute data from both the points and polygons? [duplicate]

Data: Zipped ea.ml1 shapefile can be found here, and the country outline can be downloaded here at the GADM site. I've been using the Ethiopia ESRI shapefile. Branch locations are here. I have a ...
4
votes
2answers
130 views

How to remove unwanted columns from a polygon in R AND keep the result as a spatial data frame?

To simplify my problem, I'm gonna start at the source instead of explaining my full-map problem. I have a shapefile of Ethiopia pulled from GADM (can be downloaded here). A lot of the attribute ...
0
votes
1answer
26 views

Project to NAD83 (epsg:26912) with projectRaster - gives epsg:2152

I am working with some Landsat 8 images from the U.S. Geological Survey (USGS) Earth Resources Observation and Science (EROS) Center. I am processing the images in R, and after masking the clouds, I ...
1
vote
1answer
77 views

Store into a list multiple lists

I have list of 50 lists of pairs of SpatialLinesDataFrames. That means I have something like: [[1]] [,1] [,2] [,3] [1,] spldf1 spldf3 spldf5 [2,] spldf2 spldf4 spldf6 ...
3
votes
1answer
46 views

How do I retain all attribute data when clipping two polygons in R? [duplicate]

I would first like to say that my question is very much similar to this answered one, but the proposed solutions don't seem to be working for me. I think that my question is slightly different, as I'm ...
1
vote
1answer
220 views

stack rasters with different extent and resolution in a loop with R package raster

I would like to stack rasters with the R package "raster". Layers are in ascii format. I want to crop them to have the same extent and project them to have the same resolution. My code gives raster ...
5
votes
0answers
85 views

rMaps choropleth with custom json

With R I want to make an animated choropleth map with the rMaps package and a custom map. I tried to follow the example of Diego Valle described here and to use the custom map info for Datamaps. ...