Questions tagged [r]

Statistical computing language and software environment.

811 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
21 views

Raster:area() in R before and after projecting data

I have the following snippet of code: tracts<-readOGR('data/.') proj4string(tracts) "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +...
2
votes
0answers
163 views

Writing to file geodatabase in R on Windows?

The title above basically states the question. I have looked around but haven't quite found anything yet. I see this driver: https://gdal.org/drivers/vector/filegdb.html I haven't seen any R ...
2
votes
0answers
55 views

Assign different colours to intersection between two polygons and difference area

I am quite new to GIS using R. I have two sets of data, upon which I could create two polygons like this: What I want to do is colour the common area (inner 'circle') and the space between borders. ...
2
votes
0answers
256 views

How to divide LINESTRING spatial network into equal length segments using R/sf?

I'm working on a project to model car crashes within the municipality of Milan using different statistical methods. I have a big dataset of all geocoded car accidents that happenend within the ...
2
votes
0answers
357 views

Plotting KML data on Leaflet map

I have 5 different KML files for each subzone of Singapore map. I want to plot the KML data by subzone on a Leaflet map. library(leaflet) library(raster) library(readxl) library(rgdal) setwd("F:\\...
2
votes
1answer
210 views

Split a polylines according to a specific point in R

I have 2 distinct spatial objects: on one hand I have a SpatialLinesDataFrame on the other hand I have a SpatialPointsDataFrame Considering one line and one point that intersects that line, I ...
2
votes
0answers
87 views

Biweekly time series for raster stack in r

I have a netcdf file with daily data and I calculate for each week some statistics, using the "apply.weekly" command in the "xts" library. However, I would like to calculate bi-weekly statistics, ...
2
votes
0answers
148 views

All (GeoTIFF) raster values NA after converting to velox

Cross-posted to the velox GitHub repo: https://github.com/hunzikp/velox/issues/40 I'm able to extract average tree cover values for each of the three small counties in the US State of Delaware, but ...
2
votes
0answers
52 views

Radiometrically correct one UAV image

Does anyone out there know how to perform radiometric corrections on a single image taken with a multispectral sensor? I know there is proprietary software (such as PiX4D) that can do this; however, ...
2
votes
0answers
55 views

Detecting QGIS file lock

I tried using rgdal::writeOGR in R to overwrite a SHP file that was open in QGIS. Error in writeOGR(x, "C:/myFiles", "testFile", : Creation of output file failed Not only did it fail to ...
2
votes
0answers
50 views

Removing a 'non-gap' gap from a polygon that straddles +/- 180 longitude; looking for an R-based, code solution

I am working with a set of polygons from here: http://lme.edc.uri.edu/index.php/digital-data. In the artic, there are several polygons that straddle the +/- 180 longitude line. These are single ...
2
votes
0answers
66 views

Load images into a multi-band raster in R?

I have a Landsat image with 11 bands. I need to run k means classification in R. But I do not need the whole of the image as my study area is much smaller. So I have created shapefile of the Region of ...
2
votes
0answers
97 views

Generating flow path using r.drain from rgrass

I need to generate the flow path using r.drain from the rgrass7 package in RStudio. I am new to GRASS GIS and prefer to use the R package instead. I want to generate a flow path from a grid cell. ...
2
votes
1answer
690 views

Filtering polygons by long/lat values using sf package in R?

Suppose t is: t <- structure(list(structure(list(structure(c(-89.990791, -89.990772, -89.990901, -89.99092, -89.990791, 30.727025, 30.727083, 30.727114, 30.727057, 30.727025), .Dim = c(5L, 2L))),...
2
votes
0answers
128 views

TIFF image from R displaying only white in ArcMap?

I cannot get this TIFF image, which was exported from R to display in ArcMap 10.5. I would like to georeference the nodes, but the image only displays as all white. Can someone help me with this? ...
2
votes
0answers
93 views

Points and bioclim layers plot correctly in R, but not in Maxent.jar

I am trying to use Maxent.jar. This program uses a CSV file of points and ascii bioclim layers (basically, a map of the Americas with climate data) and overlays them on top of one another. I find ...
2
votes
0answers
248 views

r - intersection of 3D objects

How can an intersection of 3D object with 3D object be done in R, for example a 3D line with 3D polygon ? Saw that "sf" provides some possibilities but didn't get the desired result. What was ...
2
votes
0answers
38 views

Creating networks and regions KML in R

I have >500 very large KMLs that contains only point data and a reference to a .png pop-up Each KML looks like this <kml xmlns:xsd="http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd" xmlns:xmlns="...
2
votes
0answers
77 views

How to create a stream graph with non-spatial data

The raw data would be like this: I want to create a streamgraph with the width of the polygon being the amount in the certain date for the certain purpose, the output should be in shapefile format : ...
2
votes
0answers
121 views

GIS Clustering with drawing predefined square area around points as cluster boundaries

I have a layer of points and I would like to create clusters where a predefined square area of 5km by 5km is the boundary for the cluster. Is there a way to iteratively draw square polygons around ...
2
votes
0answers
128 views

Any advantage to use elongated focal window for raster Pearson's Correlation?

I am performing Pearson's Correlation with 2 rasters (same res, size, extent), and will use a focal window, but is there any advantage or robustness to using a focal window that better reflects the ...
2
votes
0answers
146 views

Projection of raster to sinusoidal projection

I have my definitive raster shown below. This raster has the projection as mentioned here class : RasterLayer dimensions : 7276, 8330, 60609080 (nrow, ncol, ncell) resolution : 463.3127, ...
2
votes
0answers
514 views

Spatial analysis and parallel processing in R

I am trying to do a point-in-poly analysis using R. I have 4.5 million points and 5k polygons. This is computationally intensive. I was pointed to parallel processing through another post and tried to ...
2
votes
0answers
207 views

Calculating Moran's I on large point dataframe in R

I have a dataset of about 77,000 points of which I want to test autocorrelation. I have tried to compute the test statistic using the testSpatialAutocorrelation tool in the DHARMa package, which uses "...
2
votes
0answers
101 views

Selecting raster pixels based on dem range

I have two raster layers that are equal extent and resolution: one that is qualified as nonforest tree cover that is made up of pixels with either the value of 1 or NA, and one DEM. What I am hoping ...
2
votes
1answer
137 views

Interpolation Algorithm with gdal in R

I'm currently having some problem while trying to create a GTiFF file. require(raster) require(sp) require(rgdal) require(gdalUtils) library(rgeos) map <- readOGR ('MyShapefile.shp',layer='...
2
votes
0answers
205 views

Read only a crop or certain extent of a tif raster R

I am working with a huge amount of data in daily tif files (thousands of daily files). I am analyzing the mean of the raster in a shapefile area, repeated over potentially thousands of shape layers. ...
2
votes
0answers
384 views

Length of the boundary intersection between two polygons in R

I am trying to find the length of the border shared by two polygons. I have run cleangeo on these shapefiles. There were no flags that came up. I have looked through several other posts on the topic ...
2
votes
0answers
178 views

Cluster Points on spatial network in R/QGIS

I am searching for a method for clustering spatial points along spatial lines. The points are connected to the lines. I tried nearest neighbour clustering and gProject/gInterpolate from the rgeos ...
2
votes
0answers
228 views

Working out travel time from gdistance's conductance values in R?

Introduction This question is indirectly related to a previous post of mine (Calculating accumulated walking pace from starting location outwards using R?), but asks guidance about a different aspect, ...
2
votes
0answers
111 views

Spatial Downscaling of global temperature in R?

I am interested in spatial downscaling of global temperature to grid cell. What I have is a vector of future annual global temperature values which I would like to downscale to (hopefully) 0.5°. ...
2
votes
0answers
700 views

Make linear regression in multiple raster layers

I have a question about multiple raster layer regression using R or Arcgis. I would like to predict biomass using some Vegetation Index - VI (NDVI, EVI, SAVI, OSAVI...). and generate R² and RMSE maps ...
2
votes
0answers
244 views

Calculating combined area of multiple polygons by counting overlapping area only once in R?

I'm using a shapefile in which polygons represent the geographic distribution of species. I need to calculate the combined range of several species sets, but the overlapping areas should be counted ...
2
votes
0answers
512 views

R coordinates on line nearest to point - multiple points

In R, I have a collection of points (~15,000) within a polygon. For every point, I want to calculate the location on the polygon boundary nearest to the point's location. I'm not bothered about the ...
2
votes
0answers
463 views

R Leaflet plot ship direction

I want to plot ships and its direction on the map using R Leaflet. I tried to represent a ship as a circle and its direction with a line from the center as in the following picture. The problem is ...
2
votes
0answers
127 views

create neighborhood list in R with large dataset

I want to create a weight matrix based on distance. My code for the moment looks as follows and functions for a smaller sample of the data. However, with the large dataset (569424 individuals in 24077 ...
2
votes
0answers
402 views

how to calculate cumulative cost of movement, accounting for wind direction, in R?

I am trying to reproduce the calculation of the duration of sail-powered navigation as described in an academic article (http://www.tandfonline.com/doi/full/10.1080/15230406.2017.1403376), but using R ...
2
votes
0answers
120 views

Loading raster to R from PostgreSQL via pgGetRast takes a lot of time

I wrote R code in R Studio to load a raster (stored in PostgreSQL) to R. The database is stored here: C:\Program Files\PostgreSQL\ The following versions are installed on the computer: R version 3.4....
2
votes
0answers
244 views

R - Spatial Join Between SpatialPoints (GPS coordinates) and SpatialLinesDataFrame

I am working on a university project which combines data science and GIS. We need to find an open-source solution capable of obtaining additional information from a massive GPS coordinates dataset. ...
2
votes
0answers
209 views

Maintaining same extents in R?

How can I maintain perfectly equivalent raster and SpatialPointsDataFrame extents when in R? Each time I combine rasters, or raster and point data, the extents are very slightly different (like ...
2
votes
0answers
205 views

How to fix distortions at the edges of a UTM zone?

I have a grid of ~48000 points, however this grid has this break which coincides with two different UTM zones (36S and 37S): I don't know how this grid was obtained but it's pretty obvious to me ...
2
votes
0answers
150 views

Running Leroux model in WinBUGs

This may be a long shot, but I have been given some WinBUGs code to run a model with a Leroux prior. I'm interested in 'fixing' the precisions for Leroux prior and the intercept term in this model. ...
2
votes
0answers
548 views

R Shiny / leaflet map: Projection problem in creating map in Plate Carree projection

I'm trying to create an R Shiny map using the leaflet package to display input layers in the Plate Carree projection rather than the default Spherical Mercator projection. I've input OSM and WMS tile ...
2
votes
0answers
62 views

One-dimensional data in spatstat

I have data of one-dimensional points (locations in a straight line). I want to check if the cluster poisson process models or Cox models are a good fit for the data. Since my data only has x-...
2
votes
1answer
6k views

R plot raster: changing breaks also changes colour scale

I am trying to change the breaks of a raster in R that is show with a continuous scale. However, changing just the breaks also changes the colour scale. I am not sure how I can fix this? library(...
2
votes
0answers
379 views

Extent projection from UTM to latlon (WGS84) and back again to UTM

I'm trying to crop a raster dtm.temp1 (with higher resolution and in WGS84) at the extent of another dtm.temp (coarse resolution in UTM). Using different approch I reach different results I try ...
2
votes
0answers
1k views

Draw shapefile over PNG image in R

I have a satellite image as a PNG with known coordinates (bottom, left, top, right). I want to draw a shapefile on it (the limits of a county) in R. My first thought was to convert the PNG (it's read ...
2
votes
0answers
2k views

Combining multiple netcdf in folder in R

I have a folder that contains 61 netcdf files containing 4 dimension (lat, lon, time and depth) and 9 variables. I would like to combine all the files in the folder to one netcdf file with the ...
2
votes
0answers
380 views

Identifying activity places in GPS trajectories using R?

Is there a way in R (a script or package) that would allow identifying activity spots in GPS tracking data? I have a number of GPS tracks in GPX/CSV formats that follow the movements of people in a ...
2
votes
0answers
589 views

RQGIS R package to use QGIS functions is not working: throwing Error, UnicodeEncodeError / Python?

I am currently using R ver. 3.4.1 installed on C:\R\R-3.4.1, installed and loaded Packages: RQGIS, sp, raster. QGIS ver. 2.18.11 installed with OSGeo installer on C:\OSGeo4W64\apps\qgis. In R I am ...

1 2
3
4 5
17