# Tagged Questions

Statistical computing language and software environment.

1answer
171 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 ...
1answer
13 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 frame=F,...
0answers
125 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, ...
2answers
176 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 ...
1answer
140 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 <- data....
1answer
130 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 ...
1answer
50 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 ...
1answer
258 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 ...
1answer
76 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 ...
2answers
486 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"), ...
1answer
228 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 ...
2answers
363 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 ...
1answer
55 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 <- "https://...
0answers
65 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 coordinates)...
0answers
67 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 ...
1answer
223 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 ...
2answers
401 views

### R raster predict using lm() time series

I try to make a prediction in raster using linear regression based on past rasters but I can not capture the lm() model in order to feed it to predict(). # # calculate regression in a raster stack (...
1answer
138 views

### How to add a topographic map to a shapefile?

I wonder how it's possible to add this topographic information (elevation) to the map of Santa Cruz Island and all of the Galápagos Island that I have here. library(rgdal) library(rgeos) library(...
1answer
43 views

### Two rows of data.frame for one polygon

I am new in R and I am facing a problem. I have a list with many SpatialPolygonsDataFrames. Some of them are like this example This is a SpatialPolygonsDataFrame. My "problem" is that the data....
1answer
89 views

### What is faster - a matrix, raster or a dataframe?

I have rasters over which I am performing mathematical operations. For example, where I need to calculate flow distance or distance between two grid points. What format is generally considered faster ...
0answers
46 views

### G_Malloc error for Grass module(r.stream.extract) in R

I am having a big issue of this G_malloc Error while using a module of Grass (6.4.4) (r.stream.extract) in R. Initially I thought my computers configuration was low, So I switched to 8gb Ram 64-bit ...
1answer
141 views

### Reading netcdf sub variables and convert to raster grid in r

I want the open the fs variable which in under Retrival category and covert that into raster grid. library(ncdf4) file <- "http://co2web.jpl.nasa.gov/thredds/fileServer/OCO-2/B7101Ar_r02/2014/09/...
0answers
55 views

### Calculating flow distance of pixel from outlet using R?

I have created these raster files for a river basin: DEM Flow Direction Flow Accumulation Also, I have another raster with values of rainfall. All the 4 rasters have same spatial extent, ...
0answers
16 views

### How to join CSV data (based on admin boundary names) to shapefile of aforementioned boundaries in R? [duplicate]

DATA: CSV data, Shapefile Hi all! I'm looking to perform what I've been taught is called a spatial join. After researching this further, it's looking like this operation is most often called a ...
0answers
234 views

### Object-based classification using R and Orfeo Toolbox

I am trying to run an object-based classification using R. The Landsat images were segmented using Monteverdi (Orfeo Toolbox) and training samples (segments) were selected. My problem is that the ...
0answers
16 views

### extracting large layer netcdf using r [duplicate]

i am trying to extract layers from a large netcdf file using r my nc file variable are 5 variables:" [1] " double time_bnds[bnds,time] " [1] " double plev_bnds[bnds,plev] " [1] " ...
2answers
130 views

### Extracting a large layer from NetCDF using R

i am trying to extract specific data from an .nc file my nc file has the following variables hur-relative humidity lat-latitudes lon-longitudes time-time plev-pressure levels so i ...
1answer
73 views

### PostGIS Polygons to single sp object

I would like to be able to take my SQL queries for PostGIS and make each row for the geom attribute part of an sp object so I can plot it with R's leaflet bindings. I can't really share what my ...
2answers
244 views

### Converting binary TRMM to GeoTIFF using R?

I´m trying to convert a binary image of TRMM satellite to Geotiff format using this R code: setwd("C:/Users/Hugo/Desktop") trmm.data.file<-"C:/Users/Hugo/Desktop/3B42_daily.2013.04.22.7.bin" trmm....
1answer
337 views

### Transforming coordinates from WGS84 to Gauss-Krüger 5

GPS coordinates in the format of WGS84 are quite common. I need to transform them into Gauss-Krüger coordinates but I have no idea how to do that. The only things I know are that it is not easy and I ...
1answer
93 views

### Error in converting SpatialPolygonsDataFrame to Data Frame, R Script in QGIS

I am trying to convert a SpatialPolygonsDataFrame layer to a DataFrame to create plots using ggplot2 in an R Script within QGIS. I've used spatial join to append averages of BioClim mean temperature ...
1answer
67 views

### Reading files from grass into R with loop

I have a connection between GrassGIS and R. I want to read thousands files from my mapset into R. I have lines with names "line1","line2"... I know I have to use a loop for this so I did list_lines=...
1answer
79 views

### How do I fix distortions when reprojecting cshapes world maps?

I am using the cshapes package in R as a source of historically accurate country borders. While the default WGS 84 maps plot fine, I would like to reproject the maps. This introduces some distortions ...
1answer
115 views

### Use “facet_wrap” in ggplot2 with QGIS?

I'm using QGIS 2.6.1 and R version 3.2.2. I'm struggling to get the syntax on a R Script for creating plots via QGIS processing to work. My understanding is that R syntax in QGIS Processing is ...
0answers
58 views

### Spatial clustering gridded data with missing values (over water)

I'm trying to cluster a spatial dataset, and use the cluster labels as an input to a second process. I've been using the spdep package in R. I've got gridded data at .5 degree lat/lon resolution. ...
2answers
465 views

### How to extract all the polygon coordinates from a SpatialPolygonsDataframe?

I want to do something relatively simply but it seems to be very difficult to do, though I am very new to using R for spatial data so apologies if I've missed something obvious. I have a list ...
2answers
61 views

### Clipping a SpatialPoygonsDataFrame to another SpatialPolygonsDataFrame

How do I restrict a SpatialPolygonsDataFrame so that none of the polygons lie outside of an "underlying" SpatialPolygonsDataFrame? The application I have in mind involves Voronoi Polygons a la Carson ...
1answer
115 views

### Weighted zonal statistics in Python and/or R

I have raster files with precipitation data (4x4 km), monthly, for about 100 years. I have a shapefile for a watershed (which includes several polygons as sub-basins). I need the average precipitation ...
1answer
335 views

### How to clip a shapefile to an interpolated surface (contours) in R?

R novice here, trying to work through the ever-daunting task of clipping my data. I've posted several questions regarding how to clip various types of data, so here we go with another, complete with ...
1answer
140 views

### R: problem with rasterize getCover - not working

Are there any known bugs with the getCover argument in the rasterize function? (R package 'raster'). or has anyone got a fix for the following: I have a series of landcover polygons, here is a small ...
0answers
24 views

### Monthly GIMMS composites (example code doesn't run through)

Are there anyone familiar with r package 'gimms' ? I am trying to run this code: https://github.com/environmentalinformatics-marburg/gimms but I cant produce the monthly composites. The code gets ...
0answers
773 views

### R : How to build heatmap with the leaflet package

I read a post about interactive maps with R using the leaflet package. Very interesting by the way. In this article, the author create a heatmap like this: X=cbind(lng,lat) kde2d <- bkde2D(X, ...
1answer
138 views

### GPU support for geostatistics in R

I am using R for geostatistical analysis and spatiotemporal variogram calculations on a server. Although it has very high specifications but using variogramST takes a very long time (12 hours so far ...
2answers
59 views

### Function for hyperspectral rasters with 3 variables unexpected error

I am writing a script to extract vegetation indices from hyperspectral datacubes. One of the indices is the Triangular Vegetation Index for which I wrote the following function: TVI2 <- ...
2answers
165 views

### Devide heatmap into meaningful clusters

I created a heatmap containing population density data. Now I want to figure out the hotspots of this heat map. In other words: Where are the biggest population densities in my map? My first thought: ...
1answer
97 views

### Loop NDVI calculations for hyperspectral datacubes in R

I am writing a script for the processing of different hyperspectral datacubes. The datacubes contain flight lines that I've recorded with a UAV. In total there are 10 flight lines that need to be ...
1answer
156 views

### What is Shapely library alternative in R?

I want to manipulate 2D geospatial geometries in R. I am used to using Shapely in Python but I am a newbie in R. Can you suggest Shapely alternatives for R?
3answers
65 views

### Representation of spatial lines with altitude

Is there any R data structure that supports spatial lines that include height information? I'm looking for something like SpatialLinesDataFrame with support for altitude in the lines. Associating a ...
2answers
79 views

### Coordinates transformation

I have the following data base with information about rainfall for a set of meteorological stations: year station latitude longitude depto municipio date rainfall 1990 11010010 0527 N ...
0answers
125 views

### How to Construct Spatio Temporal Clusters of Time Series Data in R

I have count data of one disease for various districts of a state of India on monthly basis. Is it possible to draw spatio temporal clusters in R? I have checked some R- packages for example ...