pshifts: Gibson participation shifts from raw temporal turns

View source: R/pshifts.R

pshiftsR Documentation

Gibson participation shifts from raw temporal turns

Description

Gibson participation shifts from raw temporal turns

Usage

pshifts(
  dn,
  sessions = c("bounded", "collapse", "separate"),
  output = c("final", "cumulative"),
  start = NULL,
  end = NULL,
  group_events = c("simultaneous", "none"),
  plot = FALSE
)

Arguments

dn

A directed temporal network from dynet(). An undirected network raises an error of class dynet_needs_directed.

sessions

Session aggregation policy: "bounded" (the default) reads each session as its own turn sequence and pools the counts, "collapse" erases session labels and reads one calendar-ordered sequence, and "separate" reports each session on its own rows. "separate" needs a network built with a session column and raises dynet_no_sessions otherwise.

output

"final" (the default) for one row per shift class, "cumulative" for the running class vector at every turn.

start, end

Optional inclusive query limits; each query is a fresh sequence and never uses a predecessor outside the range. A network built from dates may be addressed with dates.

group_events

Infer one group-directed turn from simultaneous distinct recipients ("simultaneous", the default), or retain every dyadic row ("none"). Several turns at one instant are ordered by speaker, then group turn before dyadic turn, then target, each in the network's vertex order; the classification of consecutive turns depends on that order, so under "none" a batch of simultaneous replies is read in vertex order.

plot

Whether to draw the result as well as return it. Drawing is a side effect in the manner of graphics::hist(): the verb still returns its tidy table, invisibly when it has drawn, so plot = TRUE saves the wrapping plot() call without changing what comes back. Use plot() on the result when the figure needs arguments of its own.

Details

Only uncensored raw spell onsets inside the observed query and observation components are turns; duration, weights, fragments and terminus censoring are ignored. Consecutive turns are classified using Gibson's fixed thirteen labels. Session and component walls, loops, ties, duplicate multiplicity, and simultaneous-recipient group inference are retained in metadata. output = "final" emits one typed row per class; output = "cumulative" emits the running class vector for each turn.

Value

A dynet_pshifts data frame whose shape follows output. "final" gives one row per shift class – thirteen rows, always all thirteen even when a class never occurred – with columns shift (the Gibson label), family (the label's group) and count. "cumulative" gives one row per turn and class, that is thirteen rows per classified turn, with sequence and event locating the turn in its sequence, time, speaker, target and group describing the turn, and shift, family and count carrying the running total of that class up to and including the turn. Either shape gains a leading session column under sessions = "separate", which reports each session on its own rows; "bounded" and "collapse" carry no session column. Print it, summary() it, plot() it, or take the plain frame with as.data.frame().

Conditions

Errors: dynet_needs_directed (an undirected network; the class vector is c("dynet_needs_directed", "dynet_bad_input")), dynet_no_sessions (sessions = "separate" without a session column), dynet_outside_observation (the requested range misses observed support; it also carries dynet_bad_input), and dynet_bad_input for every other broken contract – dn not a dynet, and a start or end that is not a single finite time. An unmatched sessions, output or group_events is rejected by match.arg() and is a plain error, not a classed one.

References

Gibson, D. R. (2003). Participation shifts: Order and differentiation in group conversation. Social Forces, 81, 1335–1380. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1353/sof.2003.0055")}

Examples

dn <- dynet(data.frame(
  from = c("A", "B"), to = c("B", "A"), start = c(1, 2), end = c(1, 2)
))
pshifts(dn)

Dynet documentation built on Oct. 7, 2026, 5:08 p.m.