Statistical computing language and software environment.

learn more… | top users | synonyms

1
vote
0answers
21 views

Sub setting shape file to plot a region and addressing mismatch in ggplot & data

I am plotting India's district map with data (cases). First I read data for each district and district shape file. Later I merge the two on district. Using fortify data I get ggplot. I get a ...
-1
votes
0answers
27 views

Merge village level shapefiles by sub_district_ID to get a new shapefile using R

I am new to using R for manipulating shapefiles and need help with merging the areas inside the shapefile to a superset based on the sub_district_IDs and get a new shapefile.
0
votes
1answer
231 views

using raster.predict for Cubist model, factor levels list

I would like to thank in advance any help or advice. Let me know if I need to provide more reproducible data/code. I am working on a Cubist prediction model for soil texture, using continuous and ...
2
votes
2answers
486 views

Clump and eliminate classes in a raster in ArcMap or R

after interpolation of sediment classes, I obtained a raster which looks like the image below (sample of the river). I would like to clump and eliminate areas within the raster that are below a ...
0
votes
0answers
25 views

R - `rasterize` of polygon fails to properly take account of internal hole

I'm trying to use R to mask out a DEM raster using a polygon (loaded from a GML shape file) using the following code, where dem_modern is the raster and modern_land_shape is the vector polygon : # ...
1
vote
2answers
48 views

DBSCAN spatial clustering in R

I have file with coordinates X, Y of point objects in EPSG3301 coordinate system (that means it is in meters). I want to spatially cluster points. Here is my R code (dbscan package): db2 <-dbscan(...
2
votes
1answer
48 views

How a draw a circle (on the surface of earth) on a mercator projection?

I would like to use R and leaflet to draw a circle (a real circle on the surface of the earth) on a mercator projection. In the following code, I have the center of the circle (with lng=0 and lat=60),...
0
votes
2answers
33 views

R - Easy way to reproject an extent object

I have an extent object that I would like to re-project to lat and lon. >outer_extent outer_extent class : Extent xmin : -5559753 xmax : -4447753 ymin ...
1
vote
2answers
486 views

How to open and plot Globcolour chlorophyll image in R?

Level 3 globcolour chlorophyll images (download from hermes) are in netCDF format. Those files can be imported via ncdf package to R 3.1. ch.nc = open.ncdf("E:/Data/globclour/L3b_20140101-...
0
votes
0answers
64 views

R-Studio0.99, How to compute correlation between two rasters and serial correlation

I am using R.Studio0.99 version installed on my HP Laptop 4th generation (8GB RAM) windows 8 operating system and I know how to use R studio and some of the library to incorporate spatial data (raster,...
0
votes
1answer
97 views

Clustering of Spatial Data in R or Python [closed]

I am new to GIS. Problem Domain :- I have a stoppage data of different vehicle i.e. the point where vehicle stopped.There are some specific vehicle which stops at some particular point. So, I am ...
0
votes
0answers
29 views

What's the relationship between NetCDF dataset and ncdf4 class in R

I want to process ERA reanalysis data in R so I install RNetCDF package and ncdf4 package.When I open my reanalysis file using open.nc() and nc_open() functions separately in two packages, I found my ...
5
votes
1answer
111 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 ...
2
votes
1answer
761 views

Distance to nearest point for every point same SpatialPointsDataFrame in R

I have a SpatialPointsDataFrame that I'm working with in R. I want to add a new vector to the dataframe that contains, for every point, the distance to the nearest other point in the ...
0
votes
0answers
10 views

Using errorsarlm with two different listw objects

i am trying to estimate some spatial error models with "errorsarlm" from the spdep package. In my first regression everything is fine: sreg <- errorsarlm(map@data$avginc ~ I(as.factor(map@data$a)),...
1
vote
1answer
31 views

“Hole” argument ignored in call to Polygon function

I am working with a dataset consisting of a list of coordinates for a set of polygons. Some of these polygons are holes. However, the dataset does not follow the convention of listing the coordinates ...
3
votes
1answer
38 views

Plot a world heat map with mollweide projection in R

I have a data set with global observations with lat/lon information. There are 288 longitudes from -179.375 to 179.375 with spacing 1.25, 180 latitudes from -89.5 to 89.5 with spacing 1. There is one ...
0
votes
0answers
20 views

Identify adjacent and no-adjacent polygons between multiple shapefiles using R?

My spatial data are recorded multiple years, providing one polygon for a year. (Polygon is derived from raster data, so I can use rasters instead if it will be easier to run my calculations). I ...
1
vote
0answers
20 views

raster::intersect not producing expected results

I am having trouble with R's raster::intersect method. I give intersect a SpatialPolygonsDataFrame and SpatialPoints as documented in the raster reference manual (p. 111). The result acts like it ...
2
votes
1answer
413 views

Unable to access R from QGIS 2.4

I have been unable to run R from within QGIS on my computer. I have R version 3.03 installed and QGIS 2.4 on Windows 7. R is located at C:\Program Files\R\R-3.0.3\bin\and this is the path e specified ...
0
votes
1answer
217 views

plot 3D graph based on raster pixel values

I am new to raster data. I have a raster tif file with population density value in each grid cell. I am interested in plotting a 3D graph based on raster values in ArcGIS or R. The similar graph is ...
5
votes
4answers
183 views

How to speed up raster to polygon conversion in R?

I've decided to process my Landsat data in R instead or ArcGIS - due to my missing knowledge of python and and because of (assumed) high computation capacities of R. I want to : import r1 raster to ...
2
votes
1answer
48 views

Getting long-lat coordinates from NARR LCC-gridded data using raster and rgdal in r

I am studying migration ecology of sea ducks on the Atlantic coast of North America. In my analysis, I require substantial environmental data over a large geographic range for the past 15 years and ...
0
votes
0answers
11 views

MODISTool R Error: Can't call method “prepare”

I have already used Modistool in R a few times, but lately I am facing the following error while using the function GetProducts(), GetBands(Product = "MOD13Q1") MODISTools::GetProducts() Error in ...
0
votes
0answers
32 views

R Levelplot overlaying two SpatialPolygonsDataFrame on a RasterLayer

I'm having some trouble plotting a RasterLayer and a SpatialPolygonsDataFrame in a level plot in R. Something is wrong with the projection, but I don't manage to understand what. Here you can find my ...
0
votes
1answer
34 views

Writeogr to PostgreSQL/PostGIS database with R

I'm producing some Spatialpolygondataframes with R that I would like to upload to my PostGIS Database. I've found out that the way to do this is via the writeOGR() function using the PostgreSQL driver....
3
votes
2answers
89 views

Clustering geographical data based on point location and associated point values

Given data points with longitude, latitude, and a third property value of this point. How can I cluster points into groups (geographical sub-regions) based on the property value? I searched by google ...
1
vote
1answer
60 views

Creating a polyline with a specified slope

I would like to create a road (polyline) starting from a point, with a specified slope, until reaching the top of a hill (or going out of the DTM Raster). The dowstream slope of the DTM must always ...
1
vote
2answers
131 views

Leaflet output is grey

I would like to implement leaflet in shiny with R. I try to go with the simple examples I found online: library(leaflet) library(ggmap) somePlace <- ggmap::geocode("Vienna") # Information from ...
1
vote
1answer
33 views

Spatial correlograms for binary raster?

I have binary raster data (deforestation hotspot or not) that I would like to plot spatial correlograms for in R, to look at spatial autocorrelation over different spatial lags. I came across this ...
0
votes
1answer
65 views

Is there a R package that does spatial regularization?

By spatial regularization I mean the method described in Aitkinson and Curran (1995) "Defining an Optimal Size of Support for Remote Sensing Investigations", or Section 4.8 of Webster and Oliver (...
3
votes
2answers
37 views

Error to obtain coordinate reference system argument from a raster image in R

I got an error when i wanted to obtain the CRS from stacklayer. I don´t know what could it be. I need some advice or help to obtain it. This is my code. #LOAD RASTER LIBRARY >library(rgdal) >...
0
votes
1answer
258 views

How to convert list of stack images to time series files in R

I am using bfast package for time series analysis. But it requires the files to be read as time series. How to convert list of stacked images from 2000 to 2013 into a time series and given as input ...
2
votes
1answer
23 views

Read multiple layers of KML file using R

I have a KML that 3970 layers. I am trying to read it into R using the following script: library(rgdal) lyr <- ogrListLayers("file.KML") mykml <- readOGR("file.KML","Layer1") This works but ...
1
vote
1answer
37 views

rgdal / ggmap : rotate map data and clip map

I'm trying to plot a map of Toronto with ward boundaries and geocoded data on events over years. But the layout is such that I end up with mostly wasted space in the map. To increase resolution for ...
3
votes
2answers
131 views

Creating OUTSIDE_ONLY buffer around polygon using R?

I would like to create buffers in polygons, surrounding my original polygon. However, I want to keep only the "outside polygon", not include also original polygon. In Buffer in ArcGIS I can just set ...
0
votes
1answer
27 views

Goodness of fit of variogram model using geoR

How can I find a measure of goodness of fit (let's say an R2) of a model fitted to a variogram by the function variofit using the geoR package? The only value I have is the "minimised weighted sum of ...
0
votes
1answer
40 views

Rescale raster in R

What's the best way to rescale a raster with range 0, 200 to range -1 to 1 in R? I'm currently using gdal_translate, but this requires that I write out a new file with the updated range. If possible ...
5
votes
0answers
67 views

Is it possible to use a raster::click event within an interactive leaflet map?

Data Download: https://www.dropbox.com/s/f849ra8l6umo9d8/crops.tif?dl=0 I have various raster images of the world that I would ultimately like to plot within an interactive leaflet map; an example is ...
0
votes
1answer
25 views

Get value from list class (vector) in R [closed]

I have a simple question about corce(?) list class data into vector. I extract a tif file from polygon to achieve a list. Maybe the class of list is leaded by extract function. I check the list length ...
3
votes
1answer
36 views

Extract rasterlayer from extent class

I used extract() function to get remote sensing image cell value.The same code to process tif file produce error message. Code as follows: r1 <- raster("2000_2605_1.1_km_monthly_NDVI.tif") ...
0
votes
1answer
68 views

R equivalent of GRASS r.grow?

What is a good R equivalent of the GRASS function r.grow? The closest I've been able to find is the script suggested by whuber in response to Creating randomly shaped clumps of cells in a raster from ...
11
votes
1answer
654 views

Multispectral image segmentation for natural-resources applications using R

R has the capacity for image segmentation, although all of the examples I have come across utilize a single band for the segmentation (example). I am interested in combining R's capacity for random ...
4
votes
2answers
154 views

Changing raster calculation values - shorten this script?

i'm doing something quite straightforward regarding raster algebra but am struggling either to find the correct function or make a function work correctly; Basically I have 2 rasters, representing ...
3
votes
1answer
90 views

Put points on a projected world map

With the help from this post Lines on reprojected sp objects with Mollweide projection, I draw a world map using Mollweide projection. I also have some points with latitudes and longitudes, and I ...
2
votes
2answers
38 views

Reducing number of attributes (classes of marks) in marked point pattern using R?

I have a marked spatial point pattern loaded in R (from Shapefile). This dataset has 4 different "classes" of marks: class A, class B, class C and class D. Each class of marks is categorical. One can ...
4
votes
1answer
3k 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 ...
1
vote
0answers
17 views

R: how to export my Kriging result to raster? [duplicate]

I want to export results of my Kriging calculation to raster or some other format. My aim is to take this converted file and intersect it with another SpatialPointDataFrame (location of the point ...
4
votes
1answer
251 views

A faster polygon intersection tool than rgeos gIntersection in R?

I'm looking for a R function able to retrieve the polygon intersecting between two SpatialPolygonsDataFrame. I need to use R and the rgeos::gIntersection() is too slow in comparison with ArcGis...
1
vote
1answer
38 views

Splitting polygon into multiple fixed-width polygons along edge in R?

I have a polygon and would like to spit into grid with fixed width along with one edge. The result will look like the figure below. Are there algorithm to achieve my target? My language is R, but ...