Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 21692

Statistical computing language and software environment.

4 votes
0 answers
1k views

Open GPKG, query layers and save to new GPKG [closed]

I have recently started to use SQL and geopackages queries in R. I know how to open it, access the individual layers (geometry and tables), and select and process individual layers. …
maycca's user avatar
  • 3,386
0 votes

Measure a distance between point and the nearest NA in the raster

Here is a solution converting raster patches into polygons, and subsequently into lines, using this post library(terra) set.seed(123) # Create an empty raster and set all values to NA initially raste …
maycca's user avatar
  • 3,386
0 votes
1 answer
249 views

Measure a distance between point and the nearest NA in the raster

I have a set of points placed within one patch. I would like to measure the nearest distance between the point and the closest cell with NA values (eg. outside of my patch). Patch is defined as a cell …
maycca's user avatar
  • 3,386
0 votes
2 answers
1k views

Extract longitudinal pixel values from raster.list, save to data frame

I have a list of rasters of the same location for multiple years. The change in pixel value over time represents the time series of pixel. To further analyses, I need to extract the values over time …
maycca's user avatar
  • 3,386
0 votes
Accepted

Extract longitudinal pixel values from raster.list, save to data frame

I found another great answer here ! https://stackoverflow.com/questions/19833784/how-to-extract-values-from-rasterstack-with-xy-coordinates?rq=1 at he same time, so here it is ! No need to put raste …
maycca's user avatar
  • 3,386
1 vote
Accepted

R spatial: add new attribute to S4 class object?

The simplest answer... I had wrong position of the [i,] indexing. Instead of indexing the shapefile polys[i,]@data$open_edge <- TRUE the correct indexing is in shapefile attribute table slot polys@da …
maycca's user avatar
  • 3,386
2 votes
1 answer
2k views

R: Voronoi tesselation from long/lat data?

FALSE, sep = "") my.tab.spdf<- SpatialPointsDataFrame(cbind(my.tab$Longitude, my.tab$Latitude), my.tab) and use Voronoi tesselation published here: http://carsonfarmer.com/2009/09/voronoi-polygons-with-r/ …
maycca's user avatar
  • 3,386
1 vote
Accepted

Add Points shp attributes to Polygon shp by Point location (as Spatial Join in ArcGIS)

Here I post my answer: I missed out how to convert SpatialPolygon to SpatialPolygonDataFrame and difference between them. SpatialPolygon doesn't contain attribute table, SpatialPolygonDataFrame does. …
maycca's user avatar
  • 3,386
1 vote

Map accuracy assessment by moving window in R

This will implement moving window in raster function "modal" fun=modal to keep the majority values of neighbour values movingFun() from the {Raster}is mostly for vectors R code for focal() # matrix( …
maycca's user avatar
  • 3,386
4 votes
2 answers
1k views

Map accuracy assessment by moving window in R

However I couldn't find any approach to do use this moving window for confusion matrix evaluation in R, normally it is used to values interpolation. …
maycca's user avatar
  • 3,386
4 votes
3 answers
10k views

Save rasters created by loop operation to different directory?

I have a set of rasters. I crop them all using FOR loop. Then, I want to save new-created rasters in new directory, not in my actual directory. For one raster it is easy: writeRaster(raster1, filena …
maycca's user avatar
  • 3,386
7 votes
2 answers
11k views

How to write every raster from a list of rasters?

I have created a list of rasters - "norm" and run a several loops. Now I would like to write every created raster from "norm" (containing 1 layer) into one raster, having its specific name. # I can g …
maycca's user avatar
  • 3,386
1 vote
1 answer
559 views

R spatial: add new attribute to S4 class object?

I am trying to check if my shapefile polygons have open edge or not. To have an open edge, the polygon either has no neighbors, or is >5 m taller than its neighbours. So, I want to add this new field …
maycca's user avatar
  • 3,386
0 votes

spdep::localmoran How to access classified cluster values?

OK, I found this after correcting my googling: To access indivudual attributes of an object, one can use attributes(x)$attributeName or attr(x, attributeName). So, in my case, to access the 'mean' col …
maycca's user avatar
  • 3,386
1 vote
1 answer
2k views

Add Points shp attributes to Polygon shp by Point location (as Spatial Join in ArcGIS)

However, points attribute table is not transferred automatically in R to Voronoi tesselation polygons during calculation (as is the case in ArcGIS). …
maycca's user avatar
  • 3,386

15 30 50 per page