loess_optscale {gdverse} | R Documentation |
determine optimal spatial data analysis scale
Description
Function for determining optimal spatial data analysis scale based on locally estimated scatter plot smoothing (LOESS) model.
Usage
loess_optscale(qvec, spscalevec, increase_rate = 0.05)
Arguments
qvec |
A numeric vector of q statistics. |
spscalevec |
A numeric vector of spatial scales corresponding to |
increase_rate |
(optional) The critical increase rate of the number of discretization.
Default is |
Value
A optimal number of spatial scale
Author(s)
Wenbo Lv lyu.geosocial@gmail.com
Examples
## Not run:
## The following code takes a long time to run:
library(tidyverse)
fvcpath = "https://github.com/SpatLyu/rdevdata/raw/main/FVC.tif"
fvc = terra::rast(paste0("/vsicurl/",fvcpath))
fvc1000 = fvc %>%
terra::as.data.frame(na.rm = T) %>%
as_tibble()
fvc5000 = fvc %>%
terra::aggregate(fact = 5) %>%
terra::as.data.frame(na.rm = T) %>%
as_tibble()
qv1000 = factor_detector(fvc1000$fvc,
st_unidisc(fvc1000$premax,10,'quantile'))[[1]]
qv5000 = factor_detector(fvc5000$fvc,
st_unidisc(fvc5000$premax,10,'quantile'))[[1]]
loess_optscale(c(qv1000,qv5000),c(1000,5000))
## End(Not run)
[Package gdverse version 1.0-1 Index]