Statistical computing language and software environment.

learn more… | top users | synonyms

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 ...
3
votes
2answers
142 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 ...
5
votes
1answer
101 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) ...
3
votes
1answer
37 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 ...
3
votes
1answer
54 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 ...
1
vote
0answers
41 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 ...
0
votes
1answer
76 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 <- ...
1
vote
0answers
36 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, ...
0
votes
0answers
15 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 ...
0
votes
0answers
104 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 ...
0
votes
0answers
14 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] " ...
0
votes
1answer
43 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 ...
3
votes
1answer
59 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 ...
0
votes
2answers
82 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" ...
0
votes
1answer
179 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 ...
1
vote
1answer
63 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 ...
1
vote
1answer
52 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 ...
3
votes
1answer
49 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 ...
3
votes
1answer
62 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 ...
1
vote
0answers
34 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. ...
0
votes
2answers
145 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 ...
1
vote
2answers
49 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 ...
5
votes
1answer
73 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 ...
1
vote
1answer
106 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 ...
0
votes
1answer
99 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 ...
0
votes
0answers
22 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 ...
1
vote
0answers
252 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, ...
3
votes
1answer
104 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 ...
1
vote
2answers
52 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 <- ...
2
votes
2answers
102 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: ...
5
votes
1answer
60 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 ...
3
votes
1answer
117 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?
3
votes
3answers
52 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 ...
0
votes
2answers
67 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 ...
1
vote
0answers
43 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 ...
0
votes
0answers
24 views

Spatial join between polygons and polygons using R [duplicate]

I'm trying to make a spatial join in R between two SpatialPolygonsDataFrame's. In more detail, I have zip code and electoral precinct shapefiles, and would like to know how they overlap, i.e., for ...
3
votes
1answer
85 views

R - Programmatically convert raster stack in data frame based on polygon extraction

Sorry for cross-posting. I also posted this question at the R-SIG-GEO discussion list, but since I wanted to get as much feedback as possible I decided to post it here too. I am trying to extract ...
1
vote
0answers
57 views

Divide polyline shapefile using R

I am very new to GIS in R. I have a question that may seem simple but so far I have had no luck. I am trying to split every line in a polyline shapefile into segments of three. My original file has ...
0
votes
0answers
24 views

Raster of masked area to polygon shapefile in R

I have masked() two rasters (Landsat scenes), so that I have a new raster that covers the overlapping area of both. Now, I would like to transform the overlapping area into a polygon shapefile. Do ...
4
votes
1answer
65 views

Where are the “band names” of an ENVI file once it is imported in R?

I have a .dat file (ENVI format) with specific band names, as you can see in the snapshot. I've imported this file in R, but I cannot find the band names in the R object. The command ...
6
votes
4answers
341 views

Create interactive maps in R

I am a R user and quite new in GIS. From Adding Attribute data to shapefile? I know how to add/edit attribute data (say population) to shapefile using R. Now, I have some shapefiles with attribute ...
0
votes
1answer
112 views

Preprocessing landsat 8 images in R [closed]

I'm preprocessing landsat 8 images in R using the packages 'satellite' and 'landsat'. I tried to work with a "satellite object" derived from a stack of all my bands, but when applying the correction ...
1
vote
1answer
46 views

Creating boxplots from two rasters using the Raster package in R, using only a subset of classes from one

In R using the raster package, you can create box plots from two rasters (x and y) like so: boxplot(x,y) where: x = Raster* object y = If x is a RasterLayer object, y can be an additional ...
0
votes
0answers
14 views

compile the R arcgisbinding package against 10.2 [duplicate]

I have been searching for the way to compile R arcgisbinding against 10.2, since I don't have 10.3.1 version which is compatible for the arcgisbinding package. Is there any solution?
1
vote
0answers
51 views

What is the usefulness of the angle and direction of the sun parameters in hillshade?

These parameters refer to the angle as of elevation and direction of the sun hypothetically to the hillshade but why does that must have any importance?
2
votes
1answer
111 views

Export a QGIS print composer file (.qpt) as PDF from the command line

I have a workflow where my R script produces csv's and shapefiles. Those csv's and shapefiles then serve as layers in a QGIS project. Every time the R script is run, it overwrites the previous data, ...
0
votes
2answers
77 views

Error when reading in shp file using R

I'm trying to read in a shapefile in R, but keep getting this error: nul character not allowed (line 1). I have tried various shapefiles, all which work fine in QGIS and I have even tried ...