MyNixOS website logo
Description

Constructing Adjacency Matrices Based on Spatial and Feature Similarity.

Constructs sparse adjacency matrices from spatial coordinates, feature measurements, class labels, and temporal indices. Supports nearest-neighbor graphs, heat-kernel weights, graph Laplacians, diffusion operators, and bilateral smoothers for graph-based data analysis, following spectral graph methods in von Luxburg (2007) <doi:10.1007/s11222-007-9033-z>, diffusion maps in Coifman and Lafon (2006) <doi:10.1016/j.acha.2006.04.006>, and bilateral filtering in Tomasi and Manduchi (1998) <doi:10.1109/ICCV.1998.710815>.

adjoin

Overview

The adjoin package provides a collection of functions for constructing adjacency matrices based on spatial and feature-based similarity between data points. It enables users to analyze and visualize complex data relationships by creating spatial and feature-weighted adjacency matrices using various methods.

Installation

You can install the adjoin package from GitHub with:

# install.packages("devtools")
devtools::install_github("bbuchsbaum/adjoin")

Usage

Here’s a basic example demonstrating how to create a spatial adjacency matrix using the spatial_adjacency function:

library(adjoin)

# Generate random coordinates
coord_mat <- matrix(runif(20), nrow=10, ncol=2)

# Calculate the spatial adjacency matrix
spatial_mat <- spatial_adjacency(coord_mat, nnk=5, sigma=1)

# Inspect the resulting matrix
print(spatial_mat)
#> 10 x 10 sparse Matrix of class "dgCMatrix"
#>                                              
#>  [1,] 0.2 0.1 .   .   0.2 .   0.2 0.2 .   0.2
#>  [2,] 0.1 0.2 .   .   0.2 0.2 .   .   0.2 .  
#>  [3,] .   .   0.2 0.2 .   0.1 .   .   0.1 0.1
#>  [4,] .   .   0.2 0.2 .   0.2 .   .   0.2 0.1
#>  [5,] 0.2 0.2 .   .   0.2 .   0.1 0.1 .   .  
#>  [6,] .   0.2 0.1 0.2 .   0.2 .   .   0.2 0.1
#>  [7,] 0.2 .   .   .   0.1 .   0.2 0.2 0.1 0.2
#>  [8,] 0.2 .   .   .   0.1 .   0.2 0.2 0.1 0.2
#>  [9,] .   0.2 0.1 0.2 .   0.2 0.1 0.1 0.2 0.2
#> [10,] 0.2 .   0.1 0.1 .   0.1 0.2 0.2 0.2 0.2

For more advanced usage and additional examples, please refer to the package documentation and vignettes (coming soon).

Albers theme

This package uses the albersdown theme. Existing vignette theme hooks are replaced so albers.css and local albers.js render consistently on CRAN and GitHub Pages. The defaults are configured via params$family and params$preset (family = 'teal', preset = 'homage'). The pkgdown site uses template: { package: albersdown } together with generated pkgdown/extra.css and pkgdown/extra.js so the theme is linked and activated on site pages.

Metadata

Version

0.1.0

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows