-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Polish installation & show example
- Loading branch information
1 parent
77dfd82
commit 888f68d
Showing
3 changed files
with
197 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,3 +57,6 @@ src/rust/vendor/ | |
docs | ||
.vscode | ||
src/rust/vendor | ||
|
||
/.quarto/ | ||
README.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
--- | ||
output: github_document | ||
--- | ||
|
||
<!-- README.md is generated from README.Rmd. Please edit that file --> | ||
|
||
```{r, include = FALSE} | ||
knitr::opts_chunk$set( | ||
collapse = TRUE, | ||
comment = "#>", | ||
fig.path = "man/figures/README-", | ||
out.width = "100%" | ||
) | ||
``` | ||
|
||
# orbweaver <a><img src="https://storage.googleapis.com/ix-paquetes-internos/logo-orbweaver.png" align="right" width="30%"></a> | ||
|
||
<!-- badges: start --> | ||
[](https://cran.r-project.org/package=orbweaver) | ||
[](https://github.com/ixpantia/orbweaver/actions/workflows/check-full.yaml) | ||
<!-- badges: end --> | ||
|
||
## Overview | ||
|
||
A fast R library for working with Nodes in a graph. | ||
|
||
## Features | ||
|
||
- Find shortest paths between nodes in a graph | ||
- Find the common parents between selected nodes | ||
- Directed Graph | ||
- Directed Acyclic Graph | ||
- It is quite fast | ||
|
||
## Why not igraph? | ||
|
||
[igraph](https://igraph.org/) is an amazing network analysis package. | ||
igraph is much more mature and orbweaver focuses on extreme performance | ||
and low latency operations. If you need super high performance | ||
and do not require weighted graphs, orbweaver may be for you. | ||
|
||
 | ||
|
||
> We may add weighted graph in the future but for not | ||
> it is not in the short-term road map. | ||
## Installation | ||
|
||
### Rust Toolchain | ||
|
||
Before installing this package, you will need to install the | ||
Rust toolchain. | ||
|
||
#### Mac or Linux | ||
|
||
If you are on Mac or Linux, you can do this | ||
by running the following command in your terminal: | ||
|
||
```bash | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh | ||
``` | ||
|
||
#### Windows | ||
|
||
If you are on Windows, you can download the installer from | ||
[here](https://www.rust-lang.org/tools/install). | ||
|
||
In order to compile this package manually, you will need the | ||
**GNU ABI** used by the **GCC toolchain**. This is not the | ||
default on Windows, so you will need to install the | ||
toolchain manually. You can do this by running the following | ||
command in your terminal: | ||
|
||
```bash | ||
rustup toolchain install stable-gnu | ||
``` | ||
|
||
If you are on Windows you may need to install `Rtools` as | ||
well. You can download the installer from | ||
[here](https://cran.r-project.org/bin/windows/Rtools/). | ||
|
||
### R Package | ||
|
||
Once you have the Rust toolchain installed, you can install | ||
orbweaver from GitHub with: | ||
|
||
```R | ||
# install.packages("remotes") | ||
remotes::install_github("ixpantia/orbweaver-r") | ||
``` | ||
|
||
## Example | ||
|
||
```{r} | ||
library(orbweaver) | ||
edges <- data.frame( | ||
parent = c("A", "B", "C", "C", "F"), | ||
child = c("B", "C", "D", "E", "D") | ||
) | ||
edges | ||
graph_builder() | ||
graph <- graph_builder() |> | ||
populate_edges(edges, "parent", "child") |> | ||
build_directed() | ||
graph | ||
str(graph) | ||
graph |> find_all_paths(from = "A", to = "D") | ||
# Not the other way around | ||
graph |> find_all_paths(from = "D", to = "A") | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters