Skip to content

Commit 7385e35

Browse files
committed
Updated docs
1 parent 337625b commit 7385e35

19 files changed

+131
-64
lines changed

.Rbuildignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ build-pkg*
3434
.valgrindrc
3535
^doc$
3636
^Meta$
37+
^_pkgdown\.yml$
38+
^docs$
39+
^pkgdown$
40+
^\.github$

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/workflows/pkgdown.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
release:
9+
types: [published]
10+
workflow_dispatch:
11+
12+
name: pkgdown
13+
14+
jobs:
15+
pkgdown:
16+
runs-on: ubuntu-latest
17+
# Only restrict concurrency for non-PR jobs
18+
concurrency:
19+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
20+
env:
21+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
22+
permissions:
23+
contents: write
24+
steps:
25+
- uses: actions/checkout@v3
26+
27+
- uses: r-lib/actions/setup-pandoc@v2
28+
29+
- uses: r-lib/actions/setup-r@v2
30+
with:
31+
use-public-rspm: true
32+
33+
- uses: r-lib/actions/setup-r-dependencies@v2
34+
with:
35+
extra-packages: any::pkgdown, local::.
36+
needs: website
37+
38+
- name: Build site
39+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
40+
shell: Rscript {0}
41+
42+
- name: Deploy to GitHub pages 🚀
43+
if: github.event_name != 'pull_request'
44+
uses: JamesIves/github-pages-deploy-action@v4.4.1
45+
with:
46+
clean: false
47+
branch: gh-pages
48+
folder: docs

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,4 @@ src/*.dll
7373
inst/doc
7474
/doc/
7575
/Meta/
76+
docs

DESCRIPTION

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ Type: Package
33
Title: Network Diffusion Algorithms
44
Version: 0.2.1
55
Date: 2018-04-20
6-
Authors@R: person("Simon", "Dirmeier",
6+
Authors@R: c(person("Simon", "Dirmeier",
77
email = "simon.dirmeier@gmx.de",
8-
role = c("aut", "cre"))
8+
role = c("aut")),
9+
person("Yinchun", "Su", email = "me@yinchun.su", role = c("ctb", "cre")))
910
Maintainer: Simon Dirmeier <simon.dirmeier@gmx.de>
1011
Description: Implementation of network diffusion algorithms such as
1112
heat diffusion or Markov random walks. Network diffusion algorithms generally
@@ -20,6 +21,7 @@ License: GPL (>=3)
2021
Depends: R (>= 3.4)
2122
LazyData: TRUE
2223
LinkingTo: Rcpp, RcppEigen
24+
biocViews: sparseMatrixStats
2325
Imports:
2426
Rcpp,
2527
igraph,
@@ -34,7 +36,7 @@ Suggests:
3436
lintr,
3537
Matrix
3638
VignetteBuilder: knitr
37-
RoxygenNote: 7.2.3
39+
RoxygenNote: 7.3.0
3840
Encoding: UTF-8
3941
Config/testthat/edition: 3
4042
SystemRequirements: C++17

R/diffusr-package.R

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@
2525
#' @author Simon Dirmeier \email{simon.dirmeier@@gmx.de}
2626
#' @name diffusr-package
2727
#'
28-
#' @docType package
29-
#' @keywords package
30-
#'
3128
#' @references
3229
#'
3330
#' Tong, H., Faloutsos, C., & Pan, J. Y. (2006),

R/heat_diffusion.R

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,17 @@
2121
#' Graph diffusion using a heat diffusion process on a Laplacian matrix.
2222
#'
2323
#' @description An amount of starting heat gets distribution using the
24-
#' Laplacian matrix of a graph. Every iteration (or time interval) \code{t}
25-
#'heat streams from the starting nodes into surrounding nodes.
24+
#' Laplacian matrix of a graph. Every iteration (or time interval) \eqn{t}
25+
#' heat streams from the starting nodes into surrounding nodes.
2626
#'
2727
#' @export
2828
#'
29-
#' @param h0 an \code{n x p}-dimensional numeric non-negative vector/matrix
30-
#' of starting temperatures
31-
#' @param graph an (\code{n x n})-dimensional numeric non-negative adjacence
32-
#' matrix representing the graph
29+
#' @param h0 an \eqn{n \times p}-dimensional numeric non-negative
30+
#' \code{\link[base]{matrix}} (or
31+
#' \code{\link[Matrix:dgCMatrix-class]{dgCMatrix}},
32+
#' \code{\link[base]{vector}}) of starting temperatures
33+
#' @param graph an (\eqn{n \times n})-dimensional numeric non-negative
34+
#' adjacence matrix representing the graph
3335
#' @param t time point when heat is measured
3436
#' @param ... additional parameters
3537
#' @return returns the heat on every node as numeric vector
@@ -41,7 +43,9 @@
4143
#' @importFrom Rcpp sourceCpp
4244
#'
4345
#' @references
44-
#' \url{https://en.wikipedia.org/wiki/Laplacian_matrix} \cr
46+
#'
47+
#' \url{https://en.wikipedia.org/wiki/Laplacian_matrix}
48+
#'
4549
#' \url{https://en.wikipedia.org/wiki/Heat_equation}
4650
#'
4751
#' @examples

R/is.dgCMatrix.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Check if a matrix is `dgCMatrix` class
1+
#' Check if a matrix is \code{dgCMatrix} class
22
#'
33
#' @param mat The matrix to check
44
#'

R/mat_util.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@
2323
#' @export
2424
#'
2525
#' @param obj \code{\link[base]{matrix}} (or
26-
#' \code{\link[Matrix:dgCMatrix-class]{dgCMatrix}}, \link[base]{vector}) that
27-
#' is stochstically normalized
26+
#' \code{\link[Matrix:dgCMatrix-class]{dgCMatrix}},
27+
#' \code{\link[base]{vector}}) that is stochstically normalized
2828
#' @param ... additional params
29-
#' @return returns the normalized \code{\link[base]{matrix}} (or
30-
#' \code{\link[Matrix:dgCMatrix-class]{dgCMatrix}}, \link[base]{vector})
29+
#' @return returns the normalized matrix/vector)
3130
#'
3231
#' @importFrom checkmate assert check_matrix test_numeric test_atomic_vector
3332
#'

R/mrw.R

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@
2121
#' Graph diffusion using a Markov random walk
2222
#'
2323
#' @description
24-
#' A Markov Random Walk takes an inital distribution \code{p0}
24+
#' A Markov Random Walk takes an inital distribution \eqn{p_0}
2525
#' and calculates the stationary distribution of that.
26-
#' The diffusion process is regulated by a restart probability \code{r} which
26+
#' The diffusion process is regulated by a restart probability \eqn{r} which
2727
#' controls how often the MRW jumps back to the initial values.
2828
#'
29-
#' @param p0 an \code{n x p}-dimensional numeric non-negative vector/matrix
29+
#' @param p0 an \eqn{n \times p}-dimensional numeric non-negative vector/matrix
3030
#' representing the starting distribution of the Markov chain
3131
#' (does not need to sum to one).
3232
#'
33-
#' @param graph an (\code{n x n})-dimensional numeric non-negative adjacence
33+
#' @param graph an \eqn{n \times p}-dimensional numeric non-negative adjacence
3434
#' \code{\link[base]{matrix}} (or
3535
#' \code{\link[Matrix:dgCMatrix-class]{dgCMatrix}}) representing the graph
3636
#'
37-
#' @param r a scalar between (0, 1). restart probability if a Markov random
38-
#' walk with restart is desired
37+
#' @param r a scalar between \eqn{(0, 1)}. restart probability if a Markov
38+
#' random walk with restart is desired
3939
#'
4040
#' @param thresh threshold for breaking the iterative computation of the
4141
#' stationary distribution. If the absolute difference of the distribution at
@@ -53,7 +53,8 @@
5353
#' @param correct.for.hubs if \code{TRUE} multiplies a correction factor to the
5454
#' nodes, such that the random walk gets not biased to nodes with high
5555
#' degree. In that case the original input matrix will be normalized as:
56-
#' \deqn{ P(j | i) = 1 /degree(i) * min(1, degree(j)/degree(j))}
56+
#' \deqn{ P(j | i) = \dfrac{1}{\text{degree}(i)} \times
57+
#' \min \left(1, \dfrac{\text{degree}(j)}{\text{degree}(i)}\right)}
5758
#' \emph{Note that this will not consider edge weights.}
5859
#'
5960
#' @param allow.ergodic Allow multiple components in a graph.
@@ -62,9 +63,9 @@
6263
#'
6364
#' @return returns a list with the following elements
6465
#' \itemize{
65-
#' \item p.inf the stationary distribution as numeric vector
66-
#' \item transition.matrix the column normalized transition matrix used for
67-
#' the random walk
66+
#' \item \code{p.inf} the stationary distribution as numeric vector
67+
#' \item \code{transition.matrix} the column normalized transition matrix used
68+
#' for the random walk
6869
#' }
6970
#'
7071
#' @references

0 commit comments

Comments
 (0)