您最多能選擇 25 個主題
主題必須以字母或數字為開頭,可包含連接號「-」且最長為 35 個字元。
boB Rudis
c2c071b0f8
|
4 年前 | |
---|---|---|
R | 4 年前 | |
inst | 4 年前 | |
java | 4 年前 | |
man | 4 年前 | |
tests | 4 年前 | |
.DS_Store | 4 年前 | |
.Rbuildignore | 4 年前 | |
.gitignore | 4 年前 | |
DESCRIPTION | 4 年前 | |
NAMESPACE | 4 年前 | |
NEWS.md | 4 年前 | |
README.Rmd | 4 年前 | |
README.md | 4 年前 | |
graphstreamjars.Rproj | 4 年前 |
README.md
graphstreamjars
Java Archive Wrapper Supporting the ‘graphstream’ Package
Description
Contains all supporting JARs for working with the GraphStream Java APIs. (http://graphstream-project.org/) Version number matches version number of included ‘graphstreamjars’ libraries.
What’s Inside The Tin
The following functions are implemented:
Installation
install.packages("graphstreamjars", repos = "https://cinc.rud.is")
# or
remotes::install_git("https://git.rud.is/hrbrmstr/graphstreamjars.git")
# or
remotes::install_git("https://git.sr.ht/~hrbrmstr/graphstreamjars")
# or
remotes::install_gitlab("hrbrmstr/graphstreamjars")
# or
remotes::install_bitbucket("hrbrmstr/graphstreamjars")
# or
remotes::install_github("hrbrmstr/graphstreamjars")
NOTE: To use the ‘remotes’ install options you will need to have the {remotes} package installed.
Usage
library(rJava)
library(graphstreamjars)
packageVersion("graphstreamjars")
## [1] '1.3.0'
library(graphstreamjars)
SingleGraph <- J("org.graphstream.graph.implementations.SingleGraph")
(graph <- .jnew(SingleGraph, "Tutorial 1"))
## [1] "Java-Object{Tutorial 1}"
graph$addNode("A")
## [1] "Java-Object{A}"
graph$addNode("B")
## [1] "Java-Object{B}"
graph$addNode("C")
## [1] "Java-Object{C}"
graph$addEdge("AB", "A", "B")
## [1] "Java-Object{AB[A--B]}"
graph$addEdge("BC", "B", "C")
## [1] "Java-Object{BC[B--C]}"
graph$addEdge("CA", "C", "A")
## [1] "Java-Object{CA[C--A]}"
graph$setStrict(FALSE)
graph$setAutoCreate(TRUE)
graph$addEdge("AB", "A", "B")
## [1] "Java-Object{AB[A--B]}"
graph$addEdge("BC", "B", "C")
## [1] "Java-Object{BC[B--C]}"
graph$addEdge("CA", "C", "A")
## [1] "Java-Object{CA[C--A]}"
(A <- graph$getNode("A"))
## [1] "Java-Object{A}"
(AB <- graph$getEdge("AB"))
## [1] "Java-Object{AB[A--B]}"
ni <- graph$getNodeIterator()
while(ni$hasNext()) {
print(.jrcall(ni, "next"))
}
## [1] "Java-Object{A}"
## [1] "Java-Object{B}"
## [1] "Java-Object{C}"
graphstreamjars
Metrics
Lang | # Files | (%) | LoC | (%) | Blank lines | (%) | # Lines | (%) |
---|---|---|---|---|---|---|---|---|
XML | 1 | 0.08 | 66 | 0.32 | 0 | 0.00 | 0 | 0.00 |
Maven | 2 | 0.17 | 58 | 0.28 | 9 | 0.22 | 6 | 0.08 |
Rmd | 1 | 0.08 | 29 | 0.14 | 21 | 0.52 | 26 | 0.33 |
Java | 2 | 0.17 | 28 | 0.13 | 5 | 0.12 | 18 | 0.23 |
R | 5 | 0.42 | 15 | 0.07 | 1 | 0.02 | 28 | 0.36 |
make | 1 | 0.08 | 13 | 0.06 | 4 | 0.10 | 0 | 0.00 |