README.md

autoSTK

Installation

Supported functions

Update plan

Main features

Please note

Working example

library(autoSTK)
library(gstat)
library(spacetime)
library(stars)
library(sp)

data(air)
deair = STFDF(stations, dates, data.frame(PM10 = as.vector(air)))
deair_sf = st_as_stars(deair) %>%
    st_transform('+proj=longlat +ellps=sphere')
deair_sf = st_transform(deair_sf, 3857)
deair_r = as(deair_sf, 'STFDF')
deair_r@sp@proj4string = CRS('+init=epsg:3857')

deair_rs = deair_r[,3701:3800]
deair_rss = as(deair_rs, 'STSDF')

## autoKrigeST
akst_stk = autoKrigeST(formula = PM10~1, 
                       input_data = deair_rss, 
                       cutoff = 300000, width = 30000, tlags = 0:7, cores = 8)

akst_stk_stars = st_as_stars(akst_stk[[1]])
plot(akst_stk_stars[1,])


## autoKrigeST.cv
akst_cv_t = autoKrigeST.cv(formula = PM10~1, data = deair_rs,  nfold = 3, fold_dim = 'temporal', 
                         cutoff = 300000, width = 30000, tlags = 0:7, cores = 8)
akst_cv_s = autoKrigeST.cv(formula = PM10~1, data = deair_rs,  nfold = 3, fold_dim = 'spatial', 
                         cutoff = 300000, width = 30000, tlags = 0:7, cores = 8)
akst_cv_spt = autoKrigeST.cv(formula = PM10~1, data = deair_rs,  nfold = 4, fold_dim = 'spacetime', 
                         cutoff = 300000, width = 30000, tlags = 0:7, cores = 8)

Created on 2021-07-15 by the reprex package (v2.0.0)



sigmafelix/autoSTK documentation built on May 2, 2024, 11:23 a.m.