Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ appveyor.yml
^cran-comments.md
^CODE_OF_CONDUCT\.md$
^\.github$
^CRAN-SUBMISSION$
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
ChangeLog for networkDynamic package
v 0.3.6 update doc links and urls as requested by cran
v 0.3.5 update doc links as requested by cran
v 0.3.4 update to test to work with upcoming testthat upgrade
v 0.3.3
- CRAN-requested update to fix NOTEs about url redirects
Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tsna
Version: 0.3.5
Date: 2021-10-31
Version: 0.3.6
Date: 2025-05-04
Title: Tools for Temporal Social Network Analysis
Type: Package
Authors@R: c(
Expand All @@ -14,6 +14,6 @@ Suggests: networkDynamicData, testthat, sna, knitr, rmarkdown, relevent, ergm (>
Description: Temporal SNA tools for continuous- and discrete-time longitudinal networks having vertex, edge, and attribute dynamics stored in the 'networkDynamic' format. This work was supported by grant R01HD68395 from the National Institute of Health.
License: GPL-3
LazyLoad: yes
URL: http://statnet.org/
URL: https://statnet.org/
BugReports: https://github.com/statnet/tsna/issues
VignetteBuilder: knitr
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# `tsna`: Tools for Temporal Social Network Analysis

[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/tsna?color=2ED968)](https://cranlogs.r-pkg.org/)
[![cran version](https://www.r-pkg.org/badges/version/ergm)](https://cran.r-project.org/package=tsna)
[![Coverage status](https://codecov.io/gh/statnet/ergm/branch/master/graph/badge.svg)](https://codecov.io/github/statnet/tsna?branch=master)
[![cran version](https://www.r-pkg.org/badges/version/tsna)](https://cran.r-project.org/package=tsna)
[![Coverage status](https://app.codecov.io/gh/statnet/tsna/branch/master/graph/badge.svg)](https://app.codecov.io/github/statnet/tsna?branch=master)
[![R build status](https://github.com/statnet/tsna/workflows/R-CMD-check/badge.svg)](https://github.com/statnet/tsna/actions)

This package provides tools for exploring and describing longitudinal network data. It works with temporal network data that is stored as a `networkDynamic` object -- essentially a list in the `network` format in which elements also have an attached activity attribute, a matrix of spells indicating when vertex or edge is active. See the [networkDynamic](https://cran.r-project.org/web/packages/networkDynamic/index.html) package for more information on translating longitudinal network data from other formats (timed edge lists, lists of toggles, sets of matrices, etc).
This package provides tools for exploring and describing longitudinal network data. It works with temporal network data that is stored as a `networkDynamic` object -- essentially a list in the `network` format in which elements also have an attached activity attribute, a matrix of spells indicating when vertex or edge is active. See the [networkDynamic](https://CRAN.R-project.org/package=networkDynamic) package for more information on translating longitudinal network data from other formats (timed edge lists, lists of toggles, sets of matrices, etc).

The `tsna` package contains functions for calculating a range of descriptive statistics from longitudinal network data. Some of these are simple temporal extensions of static network descriptors, others are unique to longitudinal network data.

* Timeseries of standard 'static' social network analysis metrics

These functions operate by collapsing the dynamic network into a static network at a series of regular intervals and returning the results as a time series ts object. They can provide general description of trends in a network dataset.

- `tSnaStats` – descriptive statistics from the [sna](https://cran.r-project.org/web/packages/ergm/index.html) package. Includes both graph- and vertex-level measures such as centralities, components, reciprocity, betweenness, triad-census, etc.
- `tErgmStats` – descriptive statistics for the "terms" used in statistical Exponential-family Random Graph Models (ERGMs) from the [ergm package](https://cran.r-project.org/web/packages/ergm/index.html)
- `tSnaStats` – descriptive statistics from the [sna](https://CRAN.R-project.org/package=sna) package. Includes both graph- and vertex-level measures such as centralities, components, reciprocity, betweenness, triad-census, etc.
- `tErgmStats` – descriptive statistics for the "terms" used in statistical Exponential-family Random Graph Models (ERGMs) from the [ergm package](https://CRAN.R-project.org/package=ergm)

* Temporal path based metrics

Expand Down Expand Up @@ -48,14 +48,14 @@ The development of this software was supported by grant R01HD68395 from the Nati

## Docs and examples

The [package vignette](https://cran.r-project.org/web/packages/tsna/vignettes/tsna_vignette.html) (`browseVignettes(package='tsna')`) provides examples and illustrations of key concepts.
The [package vignette](https://cran.r-project.org/package=tsna/vignettes/tsna_vignette.html) (`browseVignettes(package='tsna')`) provides examples and illustrations of key concepts.

Examples of how `tsna` tools might be used in a network data analysis workflow can be found in our [Workshop materials](https://statnet.org/workshops/), in particular the [Temporal network tools](https://statnet.org/workshop-ndtv/) and [tergm](https://statnet.org/workshop-tergm/) workshops.


## License and attribution

This software is distributed under the GPL-3 license. It is free, open source, and has the attribution requirements (GPL Section 7) at http://statnet.org/attribution
This software is distributed under the GPL-3 license. It is free, open source, and has the attribution requirements (GPL Section 7) at https://statnet.org/attribution

To cite package ‘tsna’ in publications please use:
Bender-deMoll S, Morris M (2021). _tsna: Tools for Temporal Social Network Analysis_. R package version 0.3.5, <https://CRAN.R-project.org/package=tsna>.
Expand Down
2 changes: 1 addition & 1 deletion man/density.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tEdgeDensity(nd,mode=c('duration','event'),
%- maybe also 'usage' for other objects documented here.
\arguments{
\item{nd}{
a \code{\link{networkDynamic}} object to evaluate density on
a \code{\link[networkDynamic]{networkDynamic}} object to evaluate density on
}
\item{mode}{
option indicating if \code{'duration'} of edge spells should be considered or only the \code{'event'} count (for networks in which events have zero-durations)
Expand Down
8 changes: 4 additions & 4 deletions man/durations.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ option describing the unit of analysis that the durations or counts should be ag
numeric vector of vertex ids to consider.
}
\item{start}{
optional numeric value to be used to censor onset times. (not yet supported for vertices, must use \code{\link{net.obs.period}} instead.)
optional numeric value to be used to censor onset times. (not yet supported for vertices, must use \code{\link[networkDynamic]{net.obs.period}} instead.)
}
\item{end}{
optional numeric value to be used to censor terminus times. (not yet supported for vertices, must use \code{\link{net.obs.period}} instead.)
optional numeric value to be used to censor terminus times. (not yet supported for vertices, must use \code{\link[networkDynamic]{net.obs.period}} instead.)
}
\item{active.default}{
logial, should edges or vertices with no timing information be considered always active by default?
}
}
\details{
The function sums the durations of edge or vertex events or,in order to provide a useful metric for networks having zero-duration events, simply counts them. It is implemented by wrapping a call to \code{\link{as.data.frame.networkDynamic}} or \code{\link{get.vertex.activity}}. In many cases the output of the function will be fed to another statistical summary function like \code{summary} or \code{hist}. The level of aggregation can be selected by setting the subject to either \code{spells}, \code{edges}, or \code{dyads}.
The function sums the durations of edge or vertex events or,in order to provide a useful metric for networks having zero-duration events, simply counts them. It is implemented by wrapping a call to \code{\link[networkDynamic]{as.data.frame.networkDynamic}} or \code{\link[networkDynamic]{get.vertex.activity}}. In many cases the output of the function will be fed to another statistical summary function like \code{summary} or \code{hist}. The level of aggregation can be selected by setting the subject to either \code{spells}, \code{edges}, or \code{dyads}.

Note that the 'observed' durations may not match the 'true' (statistically estimated) durations for a network due to the censoring of edges/vertices.
}
Expand All @@ -71,7 +71,7 @@ This is an early implementation of the function and its name and arguments are s


\seealso{
See also \code{\link{as.data.frame.networkDynamic}}
See also \code{\link[networkDynamic]{as.data.frame.networkDynamic}}
}
\examples{

Expand Down
4 changes: 2 additions & 2 deletions man/incidence.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Counts or fractions of edge transitions in a networkDynamic object
}
\description{
The functions \code{tEdgeFormation} and \code{tEdgeDissolution} evaluate a network object at multiple time points and return counts (or fractions) of the number of edges forming (edge onset at time point) and dissolving (edge terminus at time point). The counts are returned as numeric vector which is a time-series object (class \code{\link{ts}}).
The functions \code{tEdgeFormation} and \code{tEdgeDissolution} evaluate a network object at multiple time points and return counts (or fractions) of the number of edges forming (edge onset at time point) and dissolving (edge terminus at time point). The counts are returned as numeric vector which is a time-series object (class \code{{ts}}).

}
\usage{
Expand All @@ -20,7 +20,7 @@ tEdgeDissolution(nd, start, end, time.interval = 1,
%- maybe also 'usage' for other objects documented here.
\arguments{
\item{nd}{
a \code{\link{networkDynamic}} object
a \code{\link[networkDynamic]{networkDynamic}} object
}
\item{start}{
optional numeric time value at which evaluation should start (default is first observed time)
Expand Down
5 changes: 2 additions & 3 deletions man/paths.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,12 @@ Unpublished discussions with James Moody and Martina Morris and the statnet team

Useful background information (for a slightly different algorithm) can be found in:
B. Bui Xuan, Afonso Ferreira, Aubin Jarry. "Computing shortest, fastest, and foremost journeys
in dynamic networks." RR-4589, 2002. https://hal.inria.fr/inria-00071996/document
in dynamic networks." RR-4589, 2002. https://inria.hal.science/inria-00071996/document

B. Bui Xuan, Afonso Ferreira, Aubin Jarry. Evolving graphs and least cost journeys in dynamic
networks. WiOpt'03: Modeling and Optimization in Mobile, Ad Hoc and Wireless Networks,
Mar 2003, Sophia Antipolis, France. 10 p., 2003
https://hal.inria.fr/inria-00466676/document

https://inria.hal.science/inria-00466676/document
}
\author{
Skye Bender-deMoll
Expand Down
22 changes: 11 additions & 11 deletions man/plotpath.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ vector of valid colors (possibly transparent) to be used for each path. Default
\item{x}{object (assumed to be \code{\link{tPath}}) to be plotted on top of a static aggregate network plot}
\item{\dots}{additional arguments to be passed to \code{\link[network]{plot.network}} and \code{\link{plot.tPath}}.
}
\item{coord}{optional numeric matrix of coordinates for positioning vertices. See \code{\link{plot.network}}}
\item{edge.col}{color for drawing edges (paths). See \code{\link{plot.network}}}
\item{edge.label.col}{color for edge labels. Default to same color as edges. See \code{\link{plot.network}}}
\item{edge.lwd}{numeric expansion factor for edge line widths. See \code{\link{plot.network}}}
\item{edge.label.cex }{numeric expansion factor for edge labels. See \code{\link{plot.network}}}
\item{displaylabels}{logical, should vertex labels be included on the plot? See \code{\link{plot.network}}}
\item{displayisolates}{logical, should isolated vertices be included in the plot? See \code{\link{plot.network}}}
\item{jitter}{adds random noise to positions (disabled by default) See \code{\link{plot.network}}}
\item{vertex.lwd}{Vertex border line with. See \code{\link{plot.network}}}
\item{vertex.cex}{Vertex expansion factor. Default is to scale up the origin vertex for the path, and not draw the other vertices. See \code{\link{plot.network}}}
\item{vertex.col}{Color for vertices. Default is to leave them un-colored. See \code{\link{plot.network}}}
\item{coord}{optional numeric matrix of coordinates for positioning vertices. See \code{\link[network]{plot.network}}}
\item{edge.col}{color for drawing edges (paths). See \code{\link[network]{plot.network}}}
\item{edge.label.col}{color for edge labels. Default to same color as edges. See \code{\link[network]{plot.network}}}
\item{edge.lwd}{numeric expansion factor for edge line widths. See \code{\link[network]{plot.network}}}
\item{edge.label.cex }{numeric expansion factor for edge labels. See \code{\link[network]{plot.network}}}
\item{displaylabels}{logical, should vertex labels be included on the plot? See \code{\link[network]{plot.network}}}
\item{displayisolates}{logical, should isolated vertices be included in the plot? See \code{\link[network]{plot.network}}}
\item{jitter}{adds random noise to positions (disabled by default) See \code{\link[network]{plot.network}}}
\item{vertex.lwd}{Vertex border line with. See \code{\link[network]{plot.network}}}
\item{vertex.cex}{Vertex expansion factor. Default is to scale up the origin vertex for the path, and not draw the other vertices. See \code{\link[network]{plot.network}}}
\item{vertex.col}{Color for vertices. Default is to leave them un-colored. See \code{\link[network]{plot.network}}}

}
\details{
Expand Down
2 changes: 1 addition & 1 deletion man/tDegree.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tDegree(nd, start, end, time.interval = 1, cmode = c("freeman", "indegree", "out
%- maybe also 'usage' for other objects documented here.
\arguments{
\item{nd}{
the \code{\link{networkDynamic}} object to be evaluated
the \code{\link[networkDynamic]{networkDynamic}} object to be evaluated
}
\item{start}{
optional numeric time value at which evaluation should start (default is first observed time)
Expand Down
6 changes: 3 additions & 3 deletions man/tErgmStats.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tErgmStats(nd, formula, start, end, time.interval = 1, aggregate.dur, rule)
%- maybe also 'usage' for other objects documented here.
\arguments{
\item{nd}{
\code{\link{networkDynamic}} object to be evaluated
\code{\link[networkDynamic]{networkDynamic}} object to be evaluated
}
\item{formula}{
a character string providing an ergm term name or the 'right hand side' of an ergm formula. For example \code{'~ edges + concurrent'}
Expand All @@ -28,10 +28,10 @@ optional numeric time value at which evaluation should end (default is last obse
optional numeric value giving time interval between evaluations (default is 1)
}
\item{aggregate.dur}{
optional numeric value giving the duration of time bin to aggregate over for each evaluation (default 0). See \code{\link{network.collapse}}
optional numeric value giving the duration of time bin to aggregate over for each evaluation (default 0). See \code{\link[networkDynamic]{network.collapse}}
}
\item{rule}{
character vector describing rule to be used if multiple attribute values are encountred when using non-zero \code{aggregate.dur}. Default is \code{latest}. See \code{\link{network.collapse}} for details
character vector describing rule to be used if multiple attribute values are encountred when using non-zero \code{aggregate.dur}. Default is \code{latest}. See \code{\link[networkDynamic]{network.collapse}} for details
}
}
\details{
Expand Down
4 changes: 2 additions & 2 deletions man/tSnaStats.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ optional numeric time value at which evaluation should end (default is last obse
optional numeric value giving time interval between evaluations (default is 1)
}
\item{aggregate.dur}{
optional numeric value giving the duration of time bin to aggregate over for each evaluation (default 0). See \code{\link{network.collapse}}
optional numeric value giving the duration of time bin to aggregate over for each evaluation (default 0). See \code{\link[networkDynamic]{network.collapse}}
}
\item{rule}{
character vector describing rule to be used if multiple attribute values are encountred when using non-zero \code{aggregate.dur}. Default is \code{latest}. See \code{\link{network.collapse}} for details
character vector describing rule to be used if multiple attribute values are encountred when using non-zero \code{aggregate.dur}. Default is \code{latest}. See \code{\link[networkDynamic]{network.collapse}} for details
}
\item{\dots}{
additional arguments to be passed on to the sna function. See docs for each function for possible arguments.
Expand Down
2 changes: 1 addition & 1 deletion man/tiedDuration.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tiedDuration(nd, mode = c("duration", "counts"),
%- maybe also 'usage' for other objects documented here.
\arguments{
\item{nd}{
a \code{\link{networkDynamic}} object describing the network for which durations should be calculated
a \code{\link[networkDynamic]{networkDynamic}} object describing the network for which durations should be calculated
}
\item{mode}{
either \code{"duration"} or \code{"count"} indicating if the sum of edge durations or the count of the number of edge events should be returned
Expand Down
Loading