Questions tagged [r]

Statistical computing language and software environment.

949 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
144 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
436 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
257 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
238 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
233 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
170 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
599 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
67 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
7k 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
472 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
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
414 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
615 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 ...
2
votes
0answers
594 views

Using R + Google Earth

I'm using emissions data in the form of netCDF files from the CMIP5 project. I've loaded this data into R as a rasterBrick and can see that it has 6 layers. My goal is to be able to use this data ...
2
votes
0answers
7k views

Error in compareRaster(c(x, rasters)) : different extent

I have a RasterStack that I want to add two rasters to. I am using this code library(rgdal) library(raster) #original rasterstack rasterfiles <- list.files("C:\\path_to_rasters", "*.tif$", ...
2
votes
0answers
402 views

R: discrepencies between pointDistance and costDistance

I'm trying to do some landscape analyses using R, and am having issues where using the pointDistance function from the raster package and the costDistance function from the gDistance package can give ...
2
votes
0answers
686 views

Download HDF NDVI in R

I have a function to automate downloading NDVI data from https://e4ftl01.cr.usgs.gov/MOLT/ However, I'm hitting an error when downloading the .HDF files. They download fine but they seem to be ...
2
votes
2answers
277 views

Read JPEG2000 in R for subsequent random forest classification

I want to use random forests in R to classify an image. My image is in jp2 format. I read Open JPEG2000 (Sentinel 2) in R and updated my rdal: rgdal: version: 1.2-5, (SVN revision 648) Geospatial ...
2
votes
0answers
225 views

Alignment, raster time-series, R

I have a Landsat raster time-series (2000-2016) of 102 rasters for the same location. Since the original Landsat scenes don't overlap exactly, I defined a polygon to use for cropping all the rasters ...
2
votes
0answers
146 views

Missing PostgreSQL driver in rgdal: a long and sad story

This issue has been discussed few times and any of the read posts have not been the ultimate answer for my case: I'm trying to load data from a PostGIS database into the R Console. While many ...
2
votes
0answers
208 views

Multiple dimensions problem in importing kml files

When I import multiple kml files into R by using readOGR in a loop, I came across the problem denotes as follows Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = ...
2
votes
0answers
526 views

Removing spatial autocorrelation (SAC) using Moran's Eigenvectors and predict distribution?

I successfully managed to incorporate moran's eigenvectors as predictor to my species distribution model using GLM (logit). I followed Dormann et al. (2007) and the appendix. I think I got corrected ...
2
votes
0answers
294 views

Joining overlapping polygons in R?

I have two shapefiles with polygons (say S1 and S2). Some of the polygons are overlapping in the two shapefiles but not perfectly. In addition some polygons from S1 are touching polygons from S2. I ...
2
votes
0answers
195 views

How to extract information from a tiff through the use of a shapefile?

I am having trouble in using the data from the South America amazon from a shapefile. What I was asked to do was to take the data from the loss of forest in a format where it is possible to make sense ...
2
votes
0answers
469 views

Create a georeferenced PDF using a shapefile and add informations in R

I created a georeferenced PDF using a shapefile and OK no problem, but I'd like to know if is possible to insert a title inside a pdf (in top position "My geo PDF"), points of interest (pts.sampling) ...
2
votes
0answers
516 views

Reading TIGER/Line gdb file into R

I am using the following instructions to read a TIGER/Line gdb into R. The first commands work correctly and print out the feature classes: fgdb <- "ACS_2014_5YR_BG_48_TEXAS.gdb" subset(...
2
votes
0answers
157 views

How to check whether two raster (RasterBrick) objects show the same trend in R (how to apply spatial testing)?

I have two RasterBrick objects in R! Both RasterBrick objects describes the same area and the same time periods. Each raster in RasterBrick stores values for one specific month. I would like to test ...
2
votes
0answers
180 views

R raster rasterToPolygon Error

I'm trying to convert a RasterBrick to polygon, across four different resolutions. It works for the coarsest three resolutions, but for the finest resolution, I get an error that I can't find much ...
2
votes
1answer
126 views

Selecting nearby polygons in QGIS?

I am working with QGIS and I have two different polygons, one with municipalities and another with conservation units (from Brazil). I need find out which Conservation units falls within 50 km from ...
2
votes
0answers
231 views

SpatialPolygonsDataFrame chloroplethr not writing to KML for GoogleMaps using R

I'm trying to do a simple chloropleth map for postal codes. I have the orginal kml exported here. When importing into R, i'm doing: library(rgdal) library(rworldmap) library(plotKML) library(...
2
votes
0answers
94 views

Railways usage - How to assign values to part of existing lines?

I am conducting a project about rail accessibility/capacity, working with railways/stations downloaded in R with Overpass. Manually I computed the number of trains for each lines and I would like to ...
2
votes
0answers
3k views

Reprojecting Rasters in R?

I have some code here that reprojects raster files. However, once in a while, I get these errors and I am not sure how to interpret the error messages. Here is my code: library(rgdal) library(...
2
votes
0answers
178 views

Calculate probability of occurrence from multiple grids

I generate a lot of spatial grid files and I want to calculate the probability that a certain threshold isn't exceeded. In this example here I want to see what's the probability of each cell that the ...
2
votes
0answers
2k views

How to use WMS in R?

I like to implement a special WMS-layer with leaflet() in R. But I have no success with the WMS-layer I like to use. library("leaflet") library("sp") # this example from the tutorial works leaflet() ...
2
votes
0answers
523 views

Converting .adf raster from UTM to lat/long without UTM zones in R

I have an .adf file that I have opened in R with the raster package. It's data on the saturation levels of Aragonite on a global scale. When I plot the raster it looks okay. But I need the data in ...
2
votes
0answers
228 views

How to find peaks by comparing with neigbhour points

I have a raster layer with 3 bands band1 - elevation data band2 - x-coord band3 - y-coord I want to run  a grid of 9*9 cells over this raster layer staring from top-left to bottom-right row-wise ...
2
votes
0answers
91 views

Simple mathematical operations using R script in QGIS

I have used several interpolation methods to create digital elevation models from a trainings data set. Now, I would like to assess the quality of each DEM by calculating the Root mean square error ...
2
votes
0answers
425 views

gstat's krige.cv() error: “Error: dimensions do not match:”

I am using krige.cv() for cross validation of a data set with 1394 locations. In my code, empirical variogram estimation, model fitting, and kriging (by krige()) everything works fine. But when I use ...
2
votes
0answers
39 views

Convert lat/lon points to gridded panel dataset?

Suppose I had a dataset that looked like df. Could someone show me how I would I summarize this panel dataset into a panel by km x km grids in R? df <- expand.grid(decade = seq(1940, 2010, 10), ...
2
votes
0answers
495 views

R code for Kernel Density Estimation

During the process of doing kernel density in R, using UK crime data as data set. Below is the work I have done so far but encounter some issues: library(ks) library(raster) data1<-subset(data,...
2
votes
0answers
481 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 ...
2
votes
0answers
436 views

How to download GPM rainfall data automatically?

How to download GPM rainfall data automatically? I tried to use DownloadGPM.R Function, but I think I had problem with Axel download accelerator. I guess I need to declare Axel as environment ...
2
votes
0answers
318 views

Kernel Density with vector output and/or possible automation?

I'm currently working on a project that will have me calculate the kernel density of a number of shapefiles with varying parameters. My current workflow goes like this: Import shapefiles in QGIS 2.10....
2
votes
0answers
169 views

TryCatch for if two extents?

I have some spatial processing in R that I want to do. After selecting out the appropriate polygon (clip1) I want to crop the raster on that polygon with the command clip1 <- crop(imported_raster, ...
2
votes
0answers
371 views

Filtering Small Areas of Shapefiles Using R

I'm trying to use the method proposed by the @ialm in the Question "How to speed up the plotting of polygons in R?" There, he loads the maps using getData from the raster package, I tested and it ...
2
votes
0answers
494 views

Find Maximum value per month in rasterstack/brick and corresponding timestamp R

When dealing with raster images, I found the raster and rts packages in R to be very flexible for analysing my raster data unlike ArcGIS. In my learning efforts, I have had to do some stacking/...
2
votes
0answers
630 views

Is there an R package for finding the maximum-area rectangle in a non-convex polygon?

Does anyone know if there is an R package out there with an algorithm which finds the largest rectangle within non-convex polygons? I have Googled, searched the R Sig Geo archives, and looked here on ...
2
votes
0answers
288 views

non-finite value supplied by optim when I use estiStAni or fit.StVariogram

I have computed an empirical spatio-temporal variogram and I want to fit it into a model I built using vgmST. However, whenever I call fit.StVariogram I get the error "non-finite value supplied by ...
2
votes
0answers
2k views

Extract values from Rasters in R based on spatial points and spatial polygons

I am trying to extract values from a raster file using the extract command in R mentioned here: http://www.inside-r.org/packages/cran/raster/docs/extract My raster file is unprojected (WGS84 ...
2
votes
0answers
101 views

Converting u and v from WGS84 to NZTM2000 - Do I need to do vector conversion?

I have u and v wind component values in latitude and longitude in WGS84. I want to convert this to NZTM2000. I've converted the lat/lon in ArcView - (and will try in R) - but do I need to also do some ...

1 2 3
4
5
19