Questions tagged [r]

Statistical computing language and software environment.

627 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
22 views

Use geometry to join Spatial Dataframe

I have two Spatial Dataframe, the first one is the Paris Polling Stations from 2012, the other is the Polling Stations from 2017. They almost have the same geography, it deffers for 20 polygons (2017 ...
1
vote
0answers
38 views

Combining Bathymetric and Elevation Data using R?

Here is some elevation data of some islands. I wish to add depth info to the water. With the generous help of @Spacedman at Overlaying elevation data and bathymetry data in R? I get: To resolve the ...
1
vote
0answers
43 views

Mean function from rts package, returns empty dataset, R

I am using the rts package in R and specifically the mean function, over a a gridded climatic dataset with many NA values. When I use apply.yearly(my_rts_object,mean) all I get is an empty raster ...
1
vote
0answers
22 views

Set attribute length when exporting features with st_write

I have sf features that I have created/manipulated in R that I need to export to shapefile (my client only accepts shapefile format so I cannot use .gpkg or other formats). I have used st_write to ...
1
vote
0answers
73 views

Why shapefiles created with sf package (in R) do not display same CRS in ArcMap?

I have created a polygon shapefile in ArcMap using 7 points(lat,lon) then read this shapefile into R to obtain the CRS. I then created a shape file in R using the sf package (and the 7 points) and ...
1
vote
0answers
73 views

R MODIS MOD13Q1 - How to handle data quality issues?

I'm running into some issues with 250m 16-day MOD13Q1 NDVI data using the MODIS package in R. Looking at the following raster plot, there are certain days where the NDVI does not match the true ...
1
vote
0answers
70 views

BIOMOD2: error message: Error in .local(sp, env, …) : object 'mask.tmp' not found

I am trying to model a plant species (composed by 298 occurrences) with BIOMOD2 using the consensus landcover as explanatory variables. However, R shows me an error message during the formatting of ...
1
vote
1answer
121 views

Converting large raster to vector?

I have a shapefile which contains 10.000 polygons and I want to know how many of them falls on a specific land use. Unfortunately, the land use map that I have to use is a raster map and not a vector ...
1
vote
1answer
74 views

R tmap: how to remove blank space when using `tm_facets()`?

I am using R package tmap to plot maps with multiple facets, using tm_facets(). It seems like space is not maximally used: there is a lot of blank/unused space on the resulting plot. Is that a ...
1
vote
0answers
46 views

Importing CSV to Carto from R?

I would like to import a csv file to my Carto account using R. I know the csv has been generated, and I'm able to save it in other locations. Running the code to upload this file to Carto appears to ...
1
vote
0answers
49 views

Reclassify raster conditional on attribute values in R

My raster has nonsensical values (based on combination of multiple rasters in previous steps), with attributes maintained (again, due to combination of rasters in previous steps), see below for sample ...
1
vote
1answer
75 views

Addition and subtraction of rasterbrick objects in R

I have two rasterbrick objects showing precipitation. Both have longitude and latitude dimensions of 144 x 72. The first (brick1) has 478 monthly time layers (39 years, 10 months) running from Jan ...
1
vote
0answers
53 views

R process: Zonal Stat Raster has No Data Values vs Arc output

I am trying to re-create my ArcGIS Zonal Stat model with R All my files will be 30m pixels; 18000 x 18000. I have used R two different ways to create the output and both create NoData values in the ...
1
vote
0answers
47 views

Warning message in raster::rotate(): “this does not look like an appropriate object for this function”

I'm attempting to rotate a stacked raster using the raster package in R. The raw stacked raster looks like this: When I attempt to rotate the raster to change the longitudinal scale from 0-360 to -...
1
vote
0answers
82 views

Orthorectification with R

How can I orthorectify an oblique image of a flat landscape when I know the conditions of the photo (coords, height, direction, lens, etc)? I would like to perform this kind of stuff from GRASS ...
1
vote
0answers
125 views

Geofencing radius distribution/ratio across multiple geofences

I understand that this problem might be simple geometry, but Im using specific shapefiles for a geographical area and looking for a specific gis solution (hopefully code). Essentially Id like to find ...
1
vote
0answers
45 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, ...
1
vote
0answers
40 views

Describe the texture features of the image through a single value in R

My purpose is to describe the characteristics of the texture of the image through a single value (eg, second angular momentum ASM), similar to what Haralick presents in Figure 4 of his article. The ...
1
vote
0answers
27 views

Plot only the borders of the states excluding the national boundary

Is there a way I can just plot the boundaries if the states excluding the national boundary of the US? I have both nation as well as state shape files from the census data. I would preferably like to ...
1
vote
0answers
23 views

Resolving topology errors after merging polygons

I have two SpatialPolygonDataFrames, and I have two merge them. SPDF1 contains watershed are falling within the country, SPDF2 has watershed are falling outside the country, so the both should match ...
1
vote
0answers
44 views

Performing PostGIS spatial joins with remote host?

I have approximately 600,000 points that must be joined to ~12 million polygons. This process happens weekly, with the potential to happen daily. The polygon data never changes, and is stored in a ...
1
vote
1answer
129 views

R levelplot: How to shade some pixels out to show statistical significance

I am posting this also on stackoverflow because the topic is in the middle between GIS and R programming. I need to include statistical significance in a map in R using rasteVis, which is based on ...
1
vote
1answer
41 views

After calling projectRaster in R, missing right edge of world map when plotting with ggplot

I'm using projectRaster and rasterToPoints in R to get a dataframe with lat/lon coordinates for plotting in ggplot but I seem to be losing the right edge of the map (New Zealand). I'm not sure if this ...
1
vote
0answers
95 views

Multipanel with raster (spplot) and scatter plot in R

I have one raster and one scatter plot that I want to put together in a single multipanel plot. However, the par(mfrow=c()) that usually works to put together different normal plots, it doesn't work ...
1
vote
0answers
63 views

Animation of Faceting maps with tm_facets

I am unable to get the facets for 3 years of provincial GDP of provinces of China. My data is as follows. structure(list(Pr_mlnyn = structure(c(2L, 27L, 10L, 25L, 19L, 18L, 17L, 11L, 24L, 15L, 31L, ...
1
vote
0answers
56 views

Geographic scale of model and covariate significance using ArcGIS Spatial Analyst and R?

A few months back I created a spatial logistic regression model of terrestrial skunk rabies in Arizona/Colorado/New Mexico/Utah. A link to the project can be found here (https://docs.wixstatic.com/ugd/...
1
vote
2answers
272 views

Zooming in on raster file in R

I used the nsidcICE function located here: https://github.com/cran/raster/blob/master/R/nsidcICE.R and the following code to open a sea ice raster file. However, I would like to overlap vector points ...
1
vote
0answers
123 views

Possible to drop NA geomType in readOGR?

I have a gdb file which is giving me trouble. f = '/path/to/folder.gdb' layers = ogrListLayers(f) geom_list = lapply(layers, readOGR, dsn = f) Gives an error on one of the layers: Source: "f", ...
1
vote
0answers
62 views

Reducing “noise” in spatially regressed points

I'm working on spatial data on a grid. I have two variables that I think to be correlated and I would like to build a model (see Fig attached). I did some exploratory analyses following the ...
1
vote
0answers
126 views

R raster - take stratified sample

This question was posted in stackexchange, where there were no views/comments/answers. I have a raster file and would like to take a stratified sample. library(raster) f = system.file("...
1
vote
1answer
66 views

Calling `Rscript` from QGIS Python Console / QGIS Plugin not working

I want to run a RScript that plots some data which is fetched by a QGIS Plugin. However it returns a non zero-exist status and breaks (when running with subprocess.check_call) or just skips the ...
1
vote
0answers
75 views

Raster centroid and relationships with geoTIFF

I have a list (s) containing information on the probable locations of many animals in South America. For example, this is the type of stored information and what it looks like when plotted for the ...
1
vote
1answer
170 views

How to filter 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))),...
1
vote
0answers
35 views

Modelling habitat heterogeneity in space: R function

I'm working on spatial landscape simulations and I would like to simulate a landscape where habitat quality varies in space. I did already some simulations assuming a landscape with higher habitat ...
1
vote
0answers
66 views

Access ArcGIS Pro conda env in R

Environment: Windows 7, ESRI ArcGIS Pro 2.1, R 3.5.1 with reticulate v1.10. ArcGIS Pro comes with a pre-configured python 3 conda environment that I'm trying to access in R. Related questions here ...
1
vote
0answers
46 views

How to get the area of the pixels of a raster in Africa Lambert Conformal Conic CRS in R

My question has been previously asked here (R How to multiply the values of the raster pixels with the true surfaces of these pixels?), I have to multiply the precipitation value of each cell by the ...
1
vote
0answers
52 views

Comparing yearly changes in TaxLot land use in NYC (mapPLUTO) - tax lots change through time

I am trying to build a database for NYC in which, for specific boroughs of the city, I track changes per tax lot unit in terms of land use and other attributes, both qualitative and quantitative. For ...
1
vote
1answer
126 views

IDW/Kriging running slow in R

I have a dataset with 2157335 entries, and I am performing IDW/Kriging to interpolate. But the code is running very slow. I am not sure this is because of a large dataset or there is something wrong ...
1
vote
0answers
26 views

Clipping polygons to existing plotting area

I have an existing plotting area onto which I want to add some polygons. In order to be sure the polygons' labels are displayed within the plotting area, I'd like to clip the polygons to this area so ...
1
vote
0answers
633 views

How to add a text on a Leaflet map

Each day I need to draw a path on a map and add a text (like 4, 5 or 8 min) indicating how long it takes by car from the starting point to the destination (see the figure below). I thought it would ...
1
vote
0answers
32 views

Silence qgis.core error messages in reticulate

I am using the qgis.core Python module in R using reticulate. I start the QgsApplication using the following code. # Start reticulate reticulate::use_python(Sys.getenv("PYTHONHOME"), require = TRUE) ...
1
vote
0answers
56 views

Spatial pattern analysis in R

This is a post originally posted on stacksoverflow, but I was recommended to post it here also. I have a lot of position data from fishing vessels, from where I would like to detect fishing ...
1
vote
0answers
105 views

R colored raster from QGIS to ggplot or tmap

I am fairly new in doing GIS work in R, but I thought this would be a nice situation to get my feet wet. Here is the situation: I need to create multiple plots with the same background, the same ...
1
vote
0answers
33 views

Swapping raster bands on disk efficiently using R

I have two raster files, each with RGB bands and an alpha layer. I would simply like to swap one of the raster's alpha bands for another, but to do so as efficiently as possible (these are very big ...
1
vote
0answers
149 views

Error in calculating covariance matrix and fitting variogram model

When constructing variogram model, usually the spatial points are given, and we build a variogram model and conduct parameter estimation. But here in my question the points are not given while ...
1
vote
0answers
175 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 ...
1
vote
0answers
227 views

SVM classification in R

I have the following dataframe containing training data to be used in a SVM classification. The first column ID must be avoided and the column Class contains the response variable. > training_S ...
1
vote
0answers
347 views

How to check spatial autocorrelation correctly in a glm

I ran a binomial glm as below and from plotting observations i know that there are many observations close to each other and i expect them to be highly correlated. For this matter after selecting the ...
1
vote
0answers
605 views

Adding color to polylines in leaflet in R

I have had a look at this and other links therein. This is exactly what I am trying to achieve and failing. Here is some sample data: structure( list( lat = c(51.88783,51.8878441,51.887825,51....
1
vote
0answers
149 views

Using SAGA-GIS topographic wetness index in R?

I want to create a topographic wetness index (TWI) in R and I am trying to set an environment according to the help of RSAGA-package but I am always facing with an error appears in a different term. ...