Questions tagged [r-stars]

Questions about the stars R package for spatiotemporal arrays.

stars is an R package for spatiotemporal arrays and raster and vector "data cubes".

58 questions
0
votes
1 answer

Apply function at grid cell level across layers of a raster file

I have a netcdf raster object with multiple layers (time: 30 years * 12 month = 360 steps). The raster is constituted of multiple grid-cells (say 1000). I want to linearly detrend each month separately and each grid cell separately to obtain a…
Raed Hamed
  • 327
  • 1
  • 10
0
votes
1 answer

r stars raster cannot be plotted: Error in attributes(.Data) <- c(attributes(.Data), attrib)

I have 6 large rasters of a soil property and I wish to plot them using facet_wrap. Each of these raster represent a different depth interval for the same area and the same property. I usually load my raster from my hard drive but this time I load…
0
votes
0 answers

reading NetCDF files - tibble columns must have compatible sizes

I like to read NetCDF files via stars::read_ncdf or tidync::tidync but get an error message like #> Error: #> ! Tibble columns must have compatible sizes. #> • Size 2: Columns `filter_id` and `filter_params`. #> • Size 3: Column `chunksizes`. #> ℹ…
ckluss
  • 1,477
  • 4
  • 21
  • 33
0
votes
1 answer

Calculate number of NA and non-NA values in a raster but with new resolution and extent

I need to calculate the number of NA and non-NA values in a raster with original resolution of 1 x 0.00811 but aggregated to 2 degrees and with a new extent. The original raster (available here:…
0
votes
0 answers

Edge detection on stars raster in R with cropped raster

I have a stars raster object called raster. I am trying to run edge detection on it like: image(rot90c(edge.detect(raster[[1]], thresh1=1, thresh2=80, noise="gaussian", noise.s=3, method="Canny"))) This works fine, but when I try to crop the…
coder11
  • 15
  • 3
0
votes
0 answers

Manipulating stars objects

My question is about tranforming "stars" class objects. As a result of a spacetime kriging, I have a stars object like the following: stars object with 2 dimensions and 1 attribute attribute(s): Min. 1st Qu. Median Mean 3rd…
0
votes
1 answer

Is it possible to create a stars object in R that is the minimum values of two other stars objects?

I have two stars objects that are read in to R as tifs: tif1 <- stars::read_stars("/data.tif") tif2 <- stars::read_stars("/data2.tif") They cover the same extent and have the same resolution. I know that I can do algebra with the objects -- for…
Ben Lee
  • 35
  • 5
0
votes
2 answers

hover over each stars and then finally click on 4th star

On a webpage I have a rating stars feedback ,When I hover on the stars they became yellow .I have 5/6 similar divs, same Class and configuration.If I hoover and click on the 4th stars, they all became yellow .What I would like to do is target the…
0
votes
1 answer

Products of all pairwise combinations of bands in two rasters with R stars package

I have two multiband rasters of class stars. They have the same resolution and extent in their first two dimensions (x and y). Each raster has multiple bands. I would like to take all pairwise combinations of bands from each of the rasters and find…
qdread
  • 3,389
  • 19
  • 36
0
votes
1 answer

Create a single raster file from a raster file with multiple layers and average the pixel values

I have to convert a raster file of class "stars" that contains 30 layers (30 values at each pixel) (466 x 435 x 30), to a new raster file of the same type (stars) with a single layer (466 x 435 x 1). For each pixel, its value should equal the…
0
votes
1 answer

How to identify the polygons in which raster values were extracted with the stars R package?

Following-up a previous question (on stackoverflow), I am trying to understand how subsetting using polygons works with the stars R package. The following code opens a raster file and crops it to a smaller dimension. library(stars) #> Loading…
Philippe Massicotte
  • 1,321
  • 12
  • 24
0
votes
1 answer

Normalizing an R stars object by grid area?

first post :) I've been transitioning my R code from sp() to sf()/stars(), and one thing I'm still trying to grasp is accounting for the area in my grids. Here's an example code to explain what I mean. library(stars) library(tidyverse) # Reading in…
JJK
  • 3
  • 1
0
votes
1 answer

Remove emtpy raster - stars package R

I have loaded a raster using stars package and then created tiles over the raster. Now i subset the raster based on these tile. tiles[[i]] <- st_bbox(c(xmin=x0,ymin=y0,xmax=x1,ymax=y1),crs=st_crs(r)) crop_tiles[[i]] <- r[tiles[[i]]] Here r is…
rw_11
  • 11
  • 2
1 2 3
4