Questions tagged [r]

Statistical computing language and software environment.

613 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
311 views

From track+waypoints to elevation profile with waypoints

I have a track and waypoints (1) imported in QGIS. I want to calculate the closest point from every waypoint to the track (2). Then, I want a table with data that allows me to draw an elevation ...
2
votes
0answers
215 views

rgdal with multiple Feature Datasets in R

I am trying to read shapefiles contained within a geodatabase file (.gdb) into R. The .gdb contains two Feature Datasets with multiple Feature Classes within each. The problem is only one of the two ...
2
votes
0answers
241 views

How to re-grid a raster using area-overlap weighted averaging?

I have two rasters r and r2 with different resolutions. I want to re-sample (re-grid) r2 to be the same as r using area-overlap weighted averaging:If an r grid cell is covered by more than 1 ...
2
votes
0answers
138 views

How to measure similarity of approximately congruent polylines

My initial question was posted here. The answer of whuber provides a nice solution for the case when polylines are congruent. However, the problem is that my polylines are approximately congruent (...
2
votes
0answers
868 views

Calculate Euclidean distance to raster WITHIN multiple polygons

I am using ArcGIS 10.1 on a Windows x64 system. I am working in a study area where I have 360 000 locations of about 50 territorial animals. I have a shapefile containing 125 sometimes overlapping ...
2
votes
0answers
245 views

kriging of compositional data (grain size)

I have posted this already in the GEONet Forum but without any suggestions, now I am hoping for some feedback here: I have a problem concerning interpolation of compositional data of grain sizes. I ...
2
votes
0answers
564 views

How to split a polygon into quadrants in R/Qgis?

I am solving the same problem as How to split a polygon into quadrants?, except that I am looking for a solution in R or QGis. So I have a polygon layer shapefile, which is unfortunatelly not exactly ...
2
votes
0answers
136 views

how to display the legend when the map contains external icons in R

I haven't found anything about the legend when the map contains icons external R (in png), is't possible to use the legend function or another function in R.
2
votes
0answers
308 views

does the census bureau provide clipped / water-bounded files as nice as certain cities?

this question says they do but when i compare what i can find in the cartographic boundary files section of the census bureau's gis page, they don't look as good as certain shapefiles provided by the ...
2
votes
0answers
378 views

spatialpolygons heatmap in R - NAs in grey?

I have a spatial polygon data-frame and I am trying to plot a heatmap via spplot. It's a map of Europe and the values for the heatmap are in a column of the data-frame. Plotting it works fine but I ...
2
votes
0answers
724 views

Doubts with Ripley's K function Interpretation

I'm a self-taught person, I'm studying the K Ripley's function and I would need some person who give me some advices. First, I have written a little script of R in QGIS processor: ##Point pattern ...
2
votes
0answers
392 views

Ecoregions shapefiles: subsetting, extracting and summarizing data from raster

I am attempting to subset and project an ecoregions shapefile from : EPA ECOREGIONS my data set is found here: SHAPEFILES and RASTER When I run this code, two major problems occur: 1) I cannot get the ...
2
votes
0answers
2k views

How to open a raw binary raster in QGIS or R

I have a raw binary raster without a file ending, and no header file. I would like to open this in either QGIS or R and then convert to geotiff, but opening it seems to be a challenge. Here is a ...
2
votes
0answers
307 views

Defining the boundary of a catchment area

I digitized contour lines from topographic maps and created a DEM. With the DEM, I estimated the boundary of a catchment area. Estimated positional accuracy of topographic maps is RMSE = 65 m, with a ...
2
votes
0answers
214 views

Write raster with its attribute table and symbology

I am classifying lots of rasters and I'd like to automate the legend creation and symbology displaying for easy manipulation. Here is the kind of raster I'm dealing with: library(raster) r <- ...
2
votes
0answers
890 views

R, GeoJSON and Leaflet

I recently learned about leafletjs.com from an R-Bloggers.com post. One such tutorial that I would like to achieve is to create interactive choropleth maps with leaflet. I have been using the rjson ...
2
votes
0answers
213 views

Moving point on OpenStreetMap route

Basically I generate random numbers in R language which are indeed times between bus arrivals. I need to simulate a moving point(a bus) in OpenStreetMap by using this generated numbers. I have read ...
2
votes
1answer
5k 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
1answer
2k views

Lagrange Multiplier in lm.LMtests (spdep package for R)

Are the Lagrange values comparable in lm.LMtests? If both RLMerr and RLMlag are significant, would the test with the largest Lagrange value be considered 'better' at explaining the spatial ...
1
vote
0answers
19 views

Adding raster layers to an existing GeoPackage in R

I have a GPKG file with a few vector layers. I have a few processing steps in my script and every now and then a new layer is added to the file. This works fine for vector layers using something like ...
1
vote
0answers
28 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 ...
1
vote
0answers
40 views

Problem creating a GeoTIFF with RGB splitting image - R

I've like to split a RGB raster in multiple pieces and save each image in GeoTiff format, but in the file name I need the count of points (pts) inside each piece. My code runs perfectly when I used a ...
1
vote
0answers
51 views

Areas of imported features in Google Earth Engine

I originally wanted to ask the following question: "In the FeaturesCollection r_features, why do the two features have such different areas? They should have the same areas because they are both ...
1
vote
0answers
23 views

Not seeing R script folder?

Similar to one of the past questions above I am struggling to see my R script folder. Although despite restarting QGIS3.6.2 and also checking in this pathway: Options > Processing > Providers, for ...
1
vote
0answers
24 views

Spatial autocorrelation coefficients interpretations

I have this result for SDM estimates in R with R2 of 54%. Is the lambda (= -2.04) which is the spatial autocorrelation coefficient a plausible value? I have read in a book that [Elhorst, 2014, P.14], ...
1
vote
1answer
68 views

R kriging raster returns NA for some prediction points?

I am trying to interpolate a raster layer of chlorophyll-a data using kriging (gstat::krige) in R, however the resulting interpolation is showing NA values in a peculiar straight line through the ...
1
vote
0answers
79 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 ...
1
vote
0answers
14 views

Compare two forest loss classifications and fill missing years: accuracy assesment or correlation?

I have a time series of forest loss rasters originating from two different classifications with some missing yearly data. Rasters represents forest loss (1) or no disturbance (0) in specific year. I ...
1
vote
0answers
17 views

How to recognize original group from unified set of polygons in R

I have simple question. How can I know the original group after apply z = sf::st_union(x, y)? I have 2 sets: length(x[[1]]) = 4253, length(y[[1]]) = 91. Finally, I have z of lenght 411 but don't know ...
1
vote
0answers
24 views

Easy way to plot separate groups of SpatialPolygons in R

I have SpatialPolygons grouped by 81 polygons and in each there are some other Polygons I'd like to plot them group by group but have little trouble with it. > rtu_spl class : ...
1
vote
0answers
22 views

How to convert from Large RasterLayer to Formal RasterLayer class in R?

I'm a bit confused about types here. While I'm loading a image: tif = raster(paste0(path)) I get some "Formal Class RasterLayer" object. But while I change it's matrix of values, for example: idx &...
1
vote
0answers
34 views

Raster projected in Google Earth Engine showing weird values within R

I classified a raster in GEE and I am trying to work with the same within R. I have 7 land cover classes and when I view the output in R, I get something that does not make sense. Please see the ...
1
vote
0answers
22 views

Getting an error when generating an SDM with the R SDM package's ensemble function

I'm attempting to build a climatic species distirbution model using 3 separate techniques: glm, maxlike, and gam. I'm using the sdm package in R. After generating the model, I'm trying to use the ...
1
vote
0answers
23 views

Error in sampleStratified() r

I am trying to randomly distribute points in a raster (that has 11 unique values). I followed this posting and was able to recreate it, being partially successful. As mentioned about, my raster has ...
1
vote
0answers
15 views

Fail to conduct resistanceGA with run_gdistance

I am using a landscape surface resistance distance counting R packages called resistanceGA It can count commuteDistance with the assistance of another package gdistance It uses the following code to ...
1
vote
0answers
36 views

Performing Spatial join with polygons using st_join in R?

I want to join 2 partly overlapping polygons in R the same way I'm doing it in ArcGIS Desktop . In ArcGIS Desktop I am doing it like this: Analysis toolbox - Overlay toolset - Spatial Join. The rows ...
1
vote
0answers
72 views

After installation of gdal (to enable PostGIS tools) on Windows, sf gives warnings about dependencies?

To get a PostgreSQL/PostGIS setup working on my Windows 10 machine I had to manually install GDAL using these instructions: https://sandbox.idre.ucla.edu/sandbox/tutorials/installing-gdal-for-windows ...
1
vote
0answers
44 views

Extract Raster Values with points in R

I have a raster file with gridded population raster26 class : RasterLayer dimensions : 132, 140, 18480 (nrow, ncol, ncell) resolution : 699, 931 (x, y) extent : 2248290, 2346150, ...
1
vote
0answers
37 views

Reducing filesize for TIFF rasters

I'm using TINinterpolation in QGIS/pyQGIS to interpolate rasters from point-based model results. Subsequent post-processing to produce a series of rasters containing index values at the same ...
1
vote
0answers
31 views

Problem of reversed coordinates (XY) when importing WFS data with st_read

This question was originally posted in StackOverflow. I am trying to use French spatial data distributed using WFS. I want to use these data in a Shiny app that allows the user to update the data, ...
1
vote
0answers
48 views

Using R-scripts in QGIS 3.4

I installed the Plugin, and activated R in the provider options. When I go to the processing toolbox R is available, but I don't have the use online R-scripts, which are mentioned in the documentation....
1
vote
0answers
30 views

Area under the spectral curve?

There is an existing similar question here that I have tried but didn't give me what I need. I have an image with 20 spectral bands. How do I compute the area under the spectral curve that is ...
1
vote
0answers
35 views

Raster correlation: Error (arg6) in raster.modified.ttest (R)

I am performing pairwise spatial correlation of 6 rasters using the raster.modified.ttest() function in R, as per this very useful post. I have consistently had the following error with my data; ...
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
41 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
21 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
71 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
68 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
62 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
94 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 ...