Statistical computing language and software environment.

learn more… | top users | synonyms

3
votes
1answer
83 views

How do I create a SpatialLinesDataFrame from a dataframe?

I have created a data.frame in R . I want to get SpatialLinesDataFrame as a result so I understand that I have to convert the data.frame into lines, the lines into SpatialLines and the SpatialLines ...
0
votes
1answer
68 views

How to extracting values of 40 plots from different bands of raster image in R?

I have 40 plots(samples) and I want to extract corresponding values from different bands of RapidEye image. So at the end I want to have totally 200 values of 5 bands in the format of txt. Till now I ...
1
vote
1answer
36 views

The shape does not fit the ggmap

I try to fit my shape to the google map. require(rgdal) in.dir <- getwd() sh <- readOGR(in.dir, layer = "Ytor", p4s = "+proj=tmerc +lat_0=0 +lon_0=15.80827777777778 +k=1 +x_0=1500000 ...
2
votes
1answer
347 views

Why is my stacked area graph in ggplot2 returned as stacked lines? [closed]

im having a bit of a problem creating my stacked area chart in ggplot2 in R, for some reason it is returning as a stacked line; eg data: library(ggplot2) Sector <- ...
2
votes
2answers
125 views

Selecting features within polygon from another layer using R or Python?

For Selecting features within polygon from another layer using QGIS? the solution was to: use the "Vector->Research tools->Select by Location" However, I would like to know how to do the same ...
1
vote
1answer
38 views

Unexpected Isopleth Output From GME

I converted a csv file to projected SpatialPointsDataFrame in R, input it to bkde2D, converted the result to raster, saved the raster to a TIFF, and input that raster into the GME Isopleth tool. Here ...
0
votes
0answers
26 views

Interpolate Points with GAM-Model

I'm trying to interpolate some point-data to a raster-map. Until now i used kriging to interpolate the point-data to the surface. now i have to use a generalized additive model for that task. my ...
0
votes
0answers
88 views

Adding additional data to R maps - package data

Is there a way to add data to additional_data result set obtained from below line of code from R maps package? additional_data <- map('county', 'iowa', fill = TRUE, col = palette()) Above ...
0
votes
1answer
62 views

How can i plot this piece of code with ggplot2? [closed]

I have these vectors of the lakes in New Guinea and the coastline and i want to plot it using ggplot2 exactly as it follows but with a more cool appearance. co<-coastline.shp ...
1
vote
0answers
61 views

Delineate watershed using manual points in RSAGA

I'm currently trying for an automated solution to delineate watersheds within a large basin. I have a collection of locations (X,Y coords) for various tributaries reaching a larger river, and the ...
2
votes
0answers
63 views

How to visualise change matrices over time

i've hit a bit of a tricky visualisation issue; I am quantifying some land use and land use change (LULUC) over a number of years. Typically, for data going from year to the next, a land change ...
1
vote
0answers
59 views

Creating grid from spatio temporal point data? [closed]

I have a spatio-temporal point data of species sighting with monthly observation for random locations within my study area. I wish to create a grid(fishnet) for each month for each year. Also, certain ...
2
votes
3answers
183 views

How to export a dataset with “SpatialPolygonsDataFrame” as a shapefile

How to export spatial datasets in R, such as tornados dataset in GISTools package, as a shapefile with the exact same spatial reference and the exact values? library(GISTools) data(tornados) ...
3
votes
0answers
82 views

Interpreting Global Moran's I and should I krig?

I am trying to weigh up if kriging (or cokriging) the residual error from my model is a valid approach. My first step was to compute whether the error is spatially autocorrelated. I have done this ...
2
votes
1answer
110 views

R-bridge minimum requirement

The new R-bridge, unveiled at uc2015, has a dependency on ArcGIS 10.3.1. Has anybody tested it with older version of ArcGIS Desktop? I need to know why it depends on 10.3.1. I need to run it on ...
0
votes
1answer
60 views

Creating polygonal windows for spatial analysis in r

I am attempting to normalize a spatial point pattern using a population density raster in r. My problem is that the function I am trying to run is recognizing the "white space" around the raster I am ...
1
vote
1answer
77 views

Programs/ languages to process netcdf files “fast”

I am using R to loop through thousands of NetCDF files (downscaled climate data), and while I am able to do it using R, the code is too slow. I am looking for a way to speed it up and to maintain ...
2
votes
2answers
70 views

How can I use a DBF layer in an R script in QGIS?

How can I use a DBF layer in an R script in QGIS? For example, I can input a vector by using ##Layer=vector, and a CSV table with ##Table=table, but it will fail if the table is based on a DBF file. ...
0
votes
0answers
44 views

Error with gwr.mixed function in GWmodel r package

I applied the gwr.basic and gwr.mixed on the same SDF file using the codes below. I got an error message on gwr.mixed: Error in SpatialPolygonsDataFrame(Sr = polygons, data = mgwr.df) : row.names ...
0
votes
0answers
36 views

reproject satellite orbit values from irregular grid to regular grid

I have a ncdf file containing measurements covering a satellite orbit. The ncdf contains the corresponding latitude / longitude fields but they ar irregularly spaced. I tried rasterizing the values ...
1
vote
1answer
57 views

Zooming into State

I am using R LeaftLet package to create a interactive choropleth of the US Map. Now my question I want both in one map itself but make zip code visible as I zoom in a state or double click on a ...
0
votes
0answers
57 views

How to effectively read and analyze multiple dbf tables?

I have multiple standalone dbf tables in a geodatabase (when saying standalone, I mean they don't have spatial components). I found this post Reading File Geodatabase using R indicated R is a ...
3
votes
2answers
84 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 ...
1
vote
0answers
36 views

Viewshed with RpyGeo “rpygeo.Viewshed.sa”

This function is not working: rpygeo.Viewshed.sa(mnt, pt,out.raster="viewshed") *Error in as.character.default(<S4 object of class "RasterLayer">) : no method for coercing this S4 class to ...
0
votes
0answers
17 views

Reclassifiy raster in R [duplicate]

I have a raster file which has been classified from 1 to 255. I have to reclassify into binary form where 1 to 11 must be classified as 1 and the rest must be 0.How would I be able to do it in R. My ...
2
votes
1answer
89 views

Proj4 for EPSG3857

I am using leaflet and the R library sp. The CRS from my leaflet map is EPSG3857 - WGS84 Web Mercator. I am retrieving the coordinates of my current map view with getBounds(). For further calculations ...
0
votes
0answers
38 views

How to convert raster files from R to arff format (for Weka software)?

I'm trying to convert some raster file to .arff format for Weka software. I used the following code to convert my files, but I got an error. Does anyone know whats the problem?
1
vote
0answers
68 views

Subset moving window when using focal on raster in R

I have a classified Landsat image, and I'd like to pass a filter over it converting certain cells to 0. For some categories, I'd like to set cells to 0 unless an entire 7x7 window contains only that ...
3
votes
1answer
77 views

Variogram for data along linear routes

I have a dataset of some measurements along a bus route (image below). The purpose of my study is to be able to detect the values at any location along the route using Kriging interpolation. I have ...
3
votes
1answer
82 views

integrate elevation and Euclidean distance

I have a number sequential GPS locations from marked animals - usually 4 to 5 locations per day for 1.5 years - and am trying to delineate seasons based on elevation and distance. From low ...
0
votes
1answer
38 views

How to convert shapefile of India into a system with longitude and latitude system?

I have two shapefiles of India. One is without PoK and other is with Pok. I want to convert the shapefile of India with PoK into a co-ordinate system with longitude and latitude (same as without PoK). ...
1
vote
2answers
56 views

Create a raster with ranges from another raster

I have a raster that contains values ranging from 1-180. I am looking for a way to create a new raster where if the values of a cell in the original raster is between 1-10 the new raster cell gets the ...
1
vote
1answer
55 views

osmar returning objects with no features- mapping with R

> src <- osmsource_api() > bb <- center_bbox(51.3528, -0.4468, 7000, 7000) > wb <- get_osm(bb, source = src) > wb osmar object 0 nodes, 0 ways, 0 relations Trying to pull data ...
1
vote
2answers
94 views

Extract raster values to points (1 per cell) for R using ArcMap?

I have created several raster layers within ArcMap that I wish to extract values from in order to analyse within R. However, I'm keen to avoid pseudo replication of my species presence data and ...
1
vote
0answers
67 views

R: Using Inverse Distance Weighting with the mapply function

I would like to find what are the optimal power parameters and number of neighbours for Inverse Distance Weighting (IDW) interpolation using the mapply command and the gstat package in R. The optimal ...
0
votes
0answers
18 views

R: Topology Exception Error

I'm trying to do the gDifference between two polygons, but I was getting an error: Error in RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, drop_not_poly, "rgeos_intersection") : TopologyException: ...
1
vote
1answer
71 views

Dissolve overlapping polygons in R

Is there an analogue of ArcGIS Dissolve function in R? I need to dissolve the overlapping polygons and create a single part object. I was trying to use gUnionCascaded, but it creates a multipart ...
2
votes
0answers
40 views

Raster memory usage in R

I am working with raster/brick data in R and running into memory issues. I am basically trying to use raster objects to perform some simple agent-based modeling, but the objects keep increasing in ...
4
votes
1answer
332 views

Batch geocoding in R

I need to find a package in R or source code in R that performs batch geocoding using Bing, Yahoo, OpenStreetmap. Do you have any suggestions?
3
votes
2answers
153 views

Snapping raster grids in R

I am trying to align two raster grids in R. Once aligned I would like to be able to add them together. I have tried to check whether making a stack would work: grid_snap <- stack(habi_sdw, ...
11
votes
2answers
140 views

How to anonymise a gps file?

Imagine you have a GPS trace that you want to make anonymous, in the legal sense. How would you do this? Is snapping to the nearest x distance and stripping out the time enough? Are there ...
1
vote
1answer
77 views

Save raster to file when using stack() in R

I'm working on a function for raster package. In the end of the function I have to use stack() to create a RasterStack. When I do this the data source is in memory. I want to have the data source on ...
2
votes
1answer
312 views

Plotting map resulted from kriging in R

I want to plot a map weighted by prices. I got a data frame of latitudes, longitudes and prices: > str(data) 'data.frame': 1253 obs. of 3 variables: $ lon : num 11.2 11.1 11 11 11.3 ... $ ...
1
vote
0answers
50 views

Matching vertices in igraph (R)

This is my first question so apologies if it's poorly explained... I'm currently using a combination of ArcMap 10.2 and igraph in R to analyse a network with associated data. I have an igraph ...
1
vote
1answer
47 views

How to get geodetic area? rgeos::gArea doesn't seem to work. Or area-preserving projection

I need to get an area of different polygons at continental scale (like third of Africa etc.). Usual functions like rgeos::gArea work only in the projection units. Is there any function which works ...
1
vote
1answer
67 views

Simple way to plot netCDF variables on Mollweide projection in R

After spending hours Googling I'm still no closer. I'm very keen to find out if there is a very simple way to plot up variables from a netCDF file that are stored in a regular lat-lon grid (-90to90˚N, ...
2
votes
1answer
22 views

Problem with automated data storing during raster::crop (‘legend’ is not a slot in class “RasterStack”)

I am working with a set of raster layers containing CHIRPS monthly rainfall amounts over Africa. For purposes of reproducing the below code, I staged the decompressed tif files on Dropbox. Now, ...
0
votes
1answer
106 views

Is there any packages to download landsat image by shapefile boundary in R or python? [closed]

I want to find a package which can automatically download images within a predefined administration boundary (shapefile format). Does anyone know a package can conduct or simplify the process?
1
vote
0answers
34 views

Can't properly map Lat/Long data on a googlemap

At the very beginning I should mention that I am a novice in spatial data handling. I am in it because I am recently doing a project where certain mining information needed to be embedded on a global ...
4
votes
1answer
133 views

Clip raster by raster with data extraction and resolution change

I need to stack multiple maps (tif) together and clip them all according to extent of one small raster map (second raster at the top of picture below). However, the size of pixels in each map is ...