https://github.com/bbuchsbaum/graphweights
R package for creating weighting matrices based on similarity relationships
https://github.com/bbuchsbaum/graphweights
Last synced: 8 months ago
JSON representation
R package for creating weighting matrices based on similarity relationships
- Host: GitHub
- URL: https://github.com/bbuchsbaum/graphweights
- Owner: bbuchsbaum
- Created: 2017-02-03T19:15:04.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2024-12-11T00:15:48.000Z (about 1 year ago)
- Last Synced: 2025-06-05T09:09:45.772Z (8 months ago)
- Language: R
- Homepage: https://bbuchsbaum.github.io/graphweights/
- Size: 4.55 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# neighborweights
## Overview
The `neighborweights` 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 `neighborweights` package from GitHub with:
```r
# install.packages("devtools")
devtools::install_github("bbuchsbaum/neighborweights")
```
##Usage
Here's a basic example demonstrating how to create a spatial adjacency matrix using the spatial_adjacency function:
```{r}
library(neighborweights)
# Generate random coordinates
coord_mat <- matrix(runif(100), 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)
```
For more advanced usage and additional examples, please refer to the package documentation and vignettes (coming soon).