Questions tagged [r-raster]

raster is an R package for geographic data analysis and modeling.

Other resources

Related tags

1217 questions
6
votes
1 answer

Counting species occurrence in a grid

I have about 500,000 points in R of occurrence data of a migratory bird species throughout the US. I am attempting to overlay a grid on these points, and then count the number of occurrences in each grid. Once the counts have been tallied, I then…
Victoria
  • 63
  • 1
  • 4
5
votes
1 answer

raster and polygons in leaflet, without raster interpolation

I'm trying to display several layers in leaflet (or mapview), one of which is a raster in EPSG:27700. The only way I manage to adequately overlay those layers is through the default latlong projection, which implies a reprojection of the raster and…
5
votes
1 answer

Saving raster - NOT UPDATED FOR PROJ >= 6

I'm having an issue saving my raster as I am getting the warning message In .gd_SetProject(object, ...) : NOT UPDATED FOR PROJ >= 6 I have searched online and updated all the relevant packages from source and think it's a problem with the crs,…
5
votes
2 answers

R microbenchmark: How to pass same argument to evaluated functions?

I'd like to evaluate the time to extract data from a raster time series using different file types (geotiff, binary) or objects (RasterBrick, RasterStack). I created a function that will extract the time series from a random point of the raster…
Daniel
  • 462
  • 3
  • 13
5
votes
0 answers

How to project a raster + polygons in Lambert 93 with leaflet on R?

I'm trying to make a leaflet map in Lambert 93 (st_transform(2154)) composed of: 1. Polygons (France) 2. Raster Layer (Europe) I can't understand why the following code is not…
antuki
  • 236
  • 2
  • 9
5
votes
2 answers

Summary Statistics of Raster By Latitudinal Intervals

Is there a quick way in R to do summary statistics on a raster based on latitudinal intervals or bins. Not a summary of the entire raster layer but spatial subsections. For example, get the mean and sd of raster cell values for every two degrees in…
Flammulation
  • 336
  • 2
  • 16
5
votes
1 answer

Keeping raster variable names when converting to NetCDF using R

Taking a raster file of monthly temperature data for multiple years which has a name attached accessible via names(object) in the following format 'Jan.1981', 'Feb.1981' etc (example files for two years that works with code below here - adding all…
Pad
  • 841
  • 2
  • 17
  • 45
5
votes
1 answer

Plot a bivariate map in R

I'm trying to plot two variables taken from raster datasets on a map in R to produce something that looks a bit like this: However, ideally I'd like the scale from bottom left to top right to be in greyscale (from light grey to black) thus…
Phil_Martin
  • 259
  • 2
  • 7
5
votes
1 answer

Linear regression between two raster images in R

I need a linear regression for calculating an empirical parameter. L1 is a raster image, format .tif. L2 is a raster image as well, calculated beforehand. Both images have the same number of columns and rows. The formula is: L1 = a + b * L2 which…
Aldi Kasse 2
  • 143
  • 1
  • 13
5
votes
1 answer

Use animate() with series of levelplots in R raster

I have a time series of 25 yearly land cover rasters. As this is categorical data, I use levelplot(inputRaster) (part of the rasterVis library) to plot a single raster. However, I would like to sequentially plot the yearly rasters, as the animate…
Niels DB
  • 69
  • 4
5
votes
1 answer

Adding scale labels to levelplot's margins

I'd like to add label showing the values of latitudinal zonal averages to levelplot's gray margin. In the following example, the min and max values for latitudinal means are 286 and 751 respectively. Any suggestion on adding an axis with this…
Geo-sp
  • 1,704
  • 3
  • 19
  • 42
5
votes
2 answers

Extract and Resample Functions in R raster package: Area-Weighted Values

I made this post in other forum as well, but since I really need a reply, i post it here once more. I am working in R and want to calculate the value of a polygon derived from the intersecting cells of a raster. The value should consider the weights…
NikMas
  • 63
  • 1
  • 6
5
votes
1 answer

Plot multiple rasters in r using layout function

I am attempting to plot five rasters in a single figure. I can easily do this with par() but I would like my multiplot to be symmetrical with the top raster centred. Creating a dummy plot works fine: m <- rbind(c(1, 1), c(2, 3), c(4,5)) print(m) …
James
  • 1,164
  • 2
  • 15
  • 36
5
votes
2 answers

plot LAT/LON coordinates on geotiff in R

I have a sea ice map as a "geotiff". The eventual goal is to extract sea-ice concentrations at specific lat/lon coordinates. The geotiff can be found at:…
Larusson
  • 267
  • 3
  • 21
5
votes
2 answers

conflict between overlay and ifelse functions in r-raster

I was running a code and found a weird behaviour when using an ifelse function inside an overlay in the raster package. In short, the function will report an error if the first 5 values of every raster is NA. Why is that happening? Below is a…
Carlos Alberto
  • 598
  • 3
  • 9