Statistical computing language and software environment.

learn more… | top users | synonyms

2
votes
0answers
57 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
105 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
52 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
48 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
47 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
85 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
48 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
55 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
56 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
41 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
70 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
49 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
24 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
64 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
62 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
66 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
44 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
62 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
44 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
44 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, ...
1
vote
1answer
180 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
50 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
66 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 ...
4
votes
0answers
84 views

Using R to map matching GPS data?

I have a bunch of 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 ...
0
votes
0answers
11 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
137 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
42 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
63 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
23 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
50 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
34 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
67 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
45 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. ...
0
votes
0answers
41 views

Call qgis function from R?

Is there a package to call QGIS functions directly from R? Is rPython the best alternative?
3
votes
1answer
96 views

Speeding up extraction time of proportion of land cover types in buffer from raster using R?

I would like to extract land cover data in a buffer of 10 km around objects of class SpatialLines and calculate proportion of each land cover type. So, I used the function extract (package raster). I ...
3
votes
1answer
10 views

Removing frame/plot borders from plot.im output

I am plotting point density using the plot.im command in spatstat, and my output always has a frame around the plotted image that becomes thicker when I increase resolution for export. I tried ...
0
votes
0answers
34 views

R rasterEngine Parallel Processing, serialized and unserialized memory errors

I am trying to perform some raster math and wanted to try parallel processing in R using rasterEngine. I am able to run the script for a few minutes and watch my CPU usage increase substantially, ...
4
votes
2answers
133 views

Editing the DBF for a shapefile is yielding totally different results in R and QGIS, but the attribute tables are identical

I'm having kind of a peculiar issue that I'm hoping someone can shed some light on. I'm actually creating my map in R, but I'm using QGIS as a tool to check my mapping process (R newb here). So let's ...
1
vote
1answer
59 views

How to use Igraph with leaflet for R?

I try to draw a graph in map with R code : df<-data.frame("from" = c("Lyon", "Toulouse", "Paris", "Marseille"), "to"= c("Paris", "Paris", "Marseille", "Toulouse")) meta <- ...
1
vote
1answer
55 views

Finding the area of polygons within other polygons in R

Is there a function in R which will loop through a layer of zonal polygons (i.e. a polygon grid) and return the area of a second polygon layer that is contained in each grid cell? I have a layer of ...
1
vote
1answer
41 views

Converting waveform LiDAR to discrete return format, in R?

I have an LVIS waveform LiDAR file which looks like this: head(lidar) V1 V2 V3 V4 V5 V6 V7 V8 V9 [1,] 529437.4 ...
0
votes
0answers
108 views

How to download the MODIS data from R using MODISTools library

I want to download MODIS product MOD13Q1 to use the Scientific Data Sets (SDS) layers of "250m_16_days_EVI", "250m_16_days_pixel_reliability". MODISTools library in R software provides the capability ...
4
votes
1answer
49 views

Wrap a raster at the 180° meridian

I have a raster file that extends longitudinally from 0° to 360°. Using R, I'd like to wrap the raster at 180°, so that longitudes between 180° and 360° are translated to the interval [-180°, 0°]. Is ...
3
votes
2answers
147 views

how to display simple arrow on the map in R using Leaflet

I try to display an arrow on the map using R and the leaflet package, code of map see my related question: # install packages install.packages(c("rgdal", "maptools", "leaflet", "htmlwidgets"), ...
0
votes
1answer
113 views

Spatial Join in R

I'm fairly new to using R for spatial work so bear with me. I have found questions similar to this but nothing that answers this question specifically enough for me to implement it. I have point data ...
3
votes
2answers
136 views

Generate HTML file with R using Leaflet

I try to display the France map on HTML with RStudio; I followed the tutorial to the World card in Creating an interactive map with leafle; Example works. I wanted to do the same just by displaying ...
3
votes
1answer
46 views

Clip beginning and end of lines in R

I have a series of lines which I need to 'top and tail' to remove the first and last x meters as roughly illustrated below with buffers of 200 m. library(geojsonio) library(rgeos) gurl <- ...
4
votes
0answers
35 views

How to interpolate within defined boundaries of a deformed mesh using R?

My goal is to create an interpolation map of some output model results that are mapped on a deformed mesh (from a numerical simulation). The model results are in an x-y plane (representing ...
0
votes
0answers
36 views

Extracting multiple values from list and storing them in data frame using R?

I have a list of 3 SpatialPolygonsDataFrames. Every element has a number which is the perimeter. I want through a loop to store the numbers into one cell of a data frame like: 154,526,442. I tried to ...
1
vote
1answer
43 views

Data frame to SpatialPolygonsDataFrame with multiple polygons

I have a data frame with a bunch of polygons, several points per polygon. How can I convert it to a SpatialPolygonsDataFrame object? Here's my data frame: > buildings_df lon lat ...