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 155720

Statistical computing language and software environment.

0 votes

Import different shapefiles with a single function into R

For example, readOGR is not a base function in R, you have to import it with library(rgdal). …
John Polo's user avatar
  • 377
2 votes
Accepted

Counting number of observations per pixel in a rasterstack

library(terra) # Create rasters for example # Basic raster r1 <- rast(ncol=2,nrow=2) # Assign values to raster cells. Notice I put an NA in one. r1[] <- c(NA,2,3,4) # Second raste …
John Polo's user avatar
  • 377
1 vote
1 answer
1k views

How to reclassify a raster in R and keep only certain values after reclassification?

I have Cropscape Data Layer raster with different vegetation types. I want to only keep pixels with values 43 and/or 54. I'm doing something wrong with the reclassify() function in R's raster package. …
John Polo's user avatar
  • 377
0 votes

Errors reassigning CRS of SpatRaster using terra::projectRaster and raster::project

Your question mixes up the libraries and functions. projectRaster is part of raster library and project is part of terra. I'm not sure what's happening with the projectRaster code. It is kind of odd t …
John Polo's user avatar
  • 377