Is there a way to have a raster gradient through NA spaces? Aiming to mimic raster output from ArcGIS GWR

51 views Asked by At

I'm trying to mimic the raster style output you get from ArcGIS Geographically Weighted Regression, where instead of simply plotting the coefficient/value in the raster cell that aligns with the coordinate point assigned the value leaving all in-between cells NA, it (at least appears to) fill them by a gradient. See ArcGIS screenshot for what I am aiming for. Thanks!

ArcGIS Style Output

R STARS output

R STARS outuput using NA omit

Here's an repex

library(tidyverse)
library(sf)
library(stars)

df <- quakes %>%
  select(depth, long, lat) %>%
  st_as_sf(coords = c("long", "lat"),
           crs = 4326)

df_rast <- st_rasterize(df)

ggplot() +
  geom_stars(data = df_rast)

ggplot() +
  geom_stars(data = df_rast,
             na.action = na.omit)
0

There are 0 answers