Statistical computing language and software environment.

learn more… | top users | synonyms

0
votes
1answer
18 views

Tearing of SpatialLinesDataFrame and problem with gClip function

I am trying to use ggmap with geom_map and geom_path commands to add a SpatialPolygonsDataFrame of African countries and a SpatialLinesDataFrame over a raster. When I use the defined function gClip() ...
0
votes
0answers
21 views

Spatial index in R - Performance enhancement on geospatial processing [on hold]

In my Geoinformatics studies, I often stumbled over the usage of spatial indices in spatial databases like here. However, I wondered if there is any possibility to use such indices in R in order to ...
1
vote
1answer
46 views

Creating spatial population heat map

I have some data that contains crab males population based on latitude and longitude. I am trying to plot the population distribution on map (not point density). For example I like to show which areas ...
0
votes
0answers
10 views

paste based in the number of elements in the row [migrated]

This is my dataframe s <- data.frame( x = c("a","b","c"), y = c("d","e", NA), z = c(NA,"j",NA) ) And I want to concatenate(paste) the values based a condition, I want to paste with comma ...
0
votes
1answer
34 views

Increase speed of reverse clip (erase) for large shapefiles in R

I would like to do a reverse clip (or erase in ArcMap) from shapefiles (polygons) then to merge the two shapefiles into a single shapefile. From this post How to 'reverse clip' (erase) in R, ...
0
votes
2answers
37 views

Failure of the function “rasterize” in R: NAs or no slots

I have some problems to convert a shapefile into a raster. I used the function rasterize (package raster) but all raster values are equal to NA. Following the answers to this question rasterize ...
1
vote
1answer
23 views

Correct Projection for calculating centroids of a group of points?

I have a long list of points covering all of North America for which I would like to calculate the centroid (by grouping points based on the "Name" column). My approach is to take the WGS84 ...
-1
votes
0answers
27 views

create a grid and extract species and climate data [on hold]

I am looking for R support to arrange my dataset which I tried and failed in Arc GIS. If you have an idea please let me know. I have 6 bioclimatic variables and 14 species. I want to create a ...
1
vote
1answer
33 views

Spearman correlation between two rasters in R

I have two rasters of the same area. The only difference is that they were created using two different methods. I would like to compare them and see how correlated they are pixel by pixel. Any ideas ...
1
vote
1answer
20 views

How to manually assign new names to attributes in a spatial data frame column with NA values

Data can be found here (Admin 1- States and Provinces, first download button): http://www.naturalearthdata.com/downloads/10m-cultural-vectors/ I have a shapefile of the world that I'll be pulling ...
0
votes
0answers
36 views

What geospatial analysis can be done easily in R but not in Python? [closed]

I'd like to present on the capabilities of R in spatial processing to a crowd more familiar with Python. I'm very familiar with R but no so much with Python. I want to wow them with some processes ...
0
votes
0answers
50 views

R raster() function failed to read tif file

I wrote a few lines to load data in TIFF to R. The function I used was: library(raster) test <- raster("file name.tif",package="raster") and it worked perfectly last week. However, now I am ...
2
votes
1answer
48 views

Tearing of polygons using ggmap and readOGR

I'm trying to incorporate a shape file of US states with ggmap and keep getting "tearing" of my polygons. I tried changing group=id to group=group which helped, but didn't seem to resolve the ...
2
votes
1answer
27 views

problem when doing algebra with raster layers in R

I'm trying to combine bioclim raster layers to create the following layer. (Q) = AnnPrec/[(Tmax+Tmin)*(Tmax-Tmin)]*1000 For that, I import a bioclim stack: envirc = ...
0
votes
1answer
26 views

How to create a continuous scale with distinct/custom color and value breaks with ggplot2 map

As stated in the title, I'm trying to create a continuous scale with distinct color and value breaks within the ggplot2 package in R. I'm using some dummy code to illustrate my problem: ...
2
votes
0answers
16 views

Adding a custom color scale for a sp.points layer to levelplot() legend

I'm wondering how I can add a customized color palette that I used to display a sp.points layer in a call to levelplot (lattice plotting) in the rasterVis package in R. I used a function that Dave X ...
2
votes
0answers
27 views

R: Setting pop-ups dependent on zoom level using leaflet

I have data that I would like to group differently, depending on the zoom scale in an interactive map made using leaflet. I have expenditure data and I would like to show expenditure by lake at ...
9
votes
2answers
360 views

Create area buffers that are limited by a coastline

I'm trying to use ArcGIS 10.2 to create a buffer of points based on a pre-defined area (e.g 400 sq km). Further to that, the buffers of some of the points are close to the coastline that requires the ...
1
vote
0answers
33 views

how to extract line features from a raster

I have a raster of land cover types where roads are represented by pixels (1 pixel = 25m x 25m = 625 m²). Is there a way to extract line features (here roads) from a raster ? ## Create raster as an ...
0
votes
0answers
29 views

Trying to run an ANOVA for fields in a dataframe [R] [migrated]

So far my code looks like this: Points = readOGR(dsn = "./Data/filename.shp",layer = "layername",stringsAsFactors = FALSE) Points$LDI = extract(LDI, Points) LDI = ...
1
vote
0answers
30 views

How to do a Kernel Density map from weighted point observations using a Cauchy kernel?

I need to produce a kernel density map, but instead of using a common kernel function such as Gaussian, I need to use the Cauchy kernel function. I have tried the Kernel Density tool in ArcGIS and ...
3
votes
1answer
77 views

Error while comparing two raster layer in R

I have got a geographic point distribution with N prehistoric settlements with a size of x and want to compare the distribution with an economic simulation, which produces M settlements (Usally N > ...
1
vote
0answers
37 views

Spplot SpatialPolygonDataFrame and SpatialGridDataFrame

I have to plot in the same graph something like this: Then, I have elements from SpatialPolygonDataFrame class and others elements from SpatialGridDataFrame class. When I try to plot them in the ...
2
votes
2answers
40 views

Use function spplot

Does anybody know how to plot with "spplot" fuction two elements of diferents classes?. One element from "SpatialPolygonDataFrame" class and other from "raster" class.
0
votes
1answer
26 views

R: raster stack (time series) loop pixelwise and write layer number of value occurence into a single output layer

I have a raster stack of gridded RFE 2.0 rainfall data (time series of one year = 365 layers). Now I wanted to identifiy on which date during the year the first rainfall occurs for each Pixel. The ...
1
vote
1answer
31 views

Error when trying to plot legend for geom_point with ggplot2

Here's some mock code to go along with my problem: #read in libraries library(ggmap) library(sp) library(raster) library(ggplot2) #read in country shapefile, project, fortify for mapping with ...
0
votes
3answers
34 views

How to add two dataframe columns of city and state names to form single city-state column for geocoding in R? [closed]

I tried to search for an answer to this, but I couldn't seem to find the right search terms, so I decided to spell it out quite explicitly. I have a data frame with separate columns for cities, ...
0
votes
1answer
117 views

Calculate line density within a buffer in R [closed]

How can I calculate road density within a buffer (km/km²)? The roads are represented by pixels (1 pixel = 625 m²) in a raster map. So I began to convert the road pixels into polylines by using the ...
0
votes
2answers
69 views

How can I convert a large csv of irregular lat/lons to regular raster GRID?

I have a large csv containing ~5 million rows containing Lat, Lon, and Depth bathymetry values. I want to generate a raster GRID (for use in Arc) from this, but the trouble is the lat/lons are ...
2
votes
0answers
34 views

R Efficient Way to Resample, Crop, and Mask a Raster Image

Does anyone know an efficient way to resample an image? I am currently trying to crop a large image and clip 2 regions from a shape file. From this clipped image, I would like to increase the pixel ...
2
votes
1answer
44 views

gBuffer(rGEOS) causing R to crash

I have downloaded a US federal lands data layer (fedlanp010g.shp.tar.gz) from http://nationalmap.gov/small_scale/atlasftp.html?openChapters=chpbound#chpbound In R, I am trying to create a buffer ...
1
vote
0answers
31 views

Get distances between boundaries from an SpatialPolygon and raster pixels

I am trying to calculate the distance from several pixels of a raster to a boundary of some polygons in R as it is showed in the image. I have two problems: How to correctly define a boundary from ...
1
vote
2answers
37 views

R calculate raster cell size in map units

I have a RasterLayer and would like to know the cell size. I haven't find any function in the packages :-S . Does someone have an idea ? info about the RasterLayer class : RasterLayer ...
0
votes
1answer
26 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
25 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
40 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
24 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
36 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
166 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 ...
0
votes
1answer
40 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
34 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
40 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 ...
5
votes
2answers
86 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
31 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
59 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
41 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
31 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
52 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
43 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
24 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 ...