Skip to content

pridiltal/mask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mask

Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. Licence

Build Status

The goal of mask is to provide a framework to detect spatial anomalies in multivariate spatio-temporal data (tensor data, multiway data). An anomaly is a spatial point or region that deviates significantly from the global and/or local distribution of a given network

Installation

You can install mask from github with:

# install.packages("devtools")
devtools::install_github("pridiltal/mask")

Example

This is a basic example which shows you how to solve a common problem:

library(mask)
library(rrcov3way)
data(Arno)

result <- find_spatial_outlier(
  data = Arno,
  tensor_decom = "Tucker3")
p <- plot_spatial_outliers(X = result$out_data)
print(p)

library(tidyverse)
library(purrr)
data <- purrr::array_tree(Arno, 3) %>%
  combine() %>%
  as_tibble() %>%
  setNames(., colnames(Arno)) %>%
  mutate(
    site = rep(rownames(Arno), dim(Arno)[3]),
    time = rep(dimnames(Arno)[[3]], each = dim(Arno)[1]),
    type = rep(result$out_data$type, dim(Arno)[3])
  ) %>%
  pivot_longer(1:11, names_to = "ID")

p <- data %>% ggplot(aes(x = ID, y = value, colour = type, group = site)) +
  geom_line() +
  facet_wrap(~time, ncol = 1, scales = "free_y") +
  scale_color_viridis_d()

print(p)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages