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
62 changes: 61 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ The GitHub page allows to access the issues assigned to you and check the commit
You can also access the documents in the repository,
although this won't be necessary after you have cloned it on your computer via Fork.

### Identifying issues

Please use the issues tracker on GitHub to identify any function-related issues.
You can use these issues to track progress on the issue and
to comment or continue a conversation on that issue.
The most useful issues are ones that precisely identify an error,
or propose a test that should pass but instead fails.
Examples for documentation are also most welcome.

Issues that belong to another package in the family should be transferred there
rather than fixed here: `gh issue transfer <number> stocnet/<package>`.
See the division of labour below.

### Cloning

Once you have downloaded Fork, the first thing you have to do is to
Expand Down Expand Up @@ -88,7 +101,8 @@ Division of labour to keep in mind when adding functions:
at the node, tie, and network level.
- `{autograph}`: drawing graphs and plotting analytic, modelling, or diagnostic results,
along with deep (often institutional) theming. *All* plot methods should live there.
- `{migraph}` (this package): testing and modelling, e.g. CUG/QAP/MRQAP and diffusion models.
- `{migraph}` (this package): testing and modelling, e.g. CUG/QAP/MRQAP and diffusion models,
and the `mpn_*` datasets.

### Style

Expand All @@ -97,6 +111,12 @@ To that end, we have a regular syntax that users can rely on producing expected
Functions in the same family (`test_*()`, `over_*()`, etc.) should share
argument order and naming, so that behaviour is guessable across the family.

When writing documentation or NEWS items, prefer breaking lines at punctuation.

Make it clear when you are referring to functions by adding backticks and parentheses,
e.g. `a_function()`, and arguments by adding an equals sign, e.g. `argument=`.
Argument values or variables can be in double quotation marks, e.g. "value".

### Common commands

This is a standard R package developed with `devtools`/`roxygen2`.
Expand Down Expand Up @@ -183,6 +203,46 @@ versions rather than by changing `migraph`'s own code — see `cran-comments.md`
guard such code paths with the `thisRequires()` helper in
[R/migraph-package.R](../R/migraph-package.R), which prompts to install on first use.

### Datasets

The `mpn_*` datasets accompany *Multimodal Political Networks*.
They are the part of this package that will remain after the inferential
functions move, so their conventions matter.

**Naming.** Lower case throughout, with no capitals:
`mpn_evs_ita`, not `mpn_IT`.
Group by source, then narrow: `mpn_evs_*`, `mpn_cow_*`, `mpn_elite_*`.
Use the ISO three-letter code for a country.

**Class.** Every dataset is a `stocnet` object.
Build one as a list with the slots `info`, `nodes`, `ties`, `changes`, `globals`,
and `missings` where there are unobserved dyads.

| Slot | Holds |
|---|---|
| `nodes$label` | the node name |
| `nodes$mode` | a **character** name for each set of nodes, two or more values |
| `ties$layer` | a character name for each tie type |
| `ties$time` | the observation time |
| `missings` | unobserved dyads, kept out of `ties` |
| `info` | provenance, written with `manynet::add_info()` |

Two traps when converting.
`manynet::as_stocnet()` writes `nodes$mode` as the strings `"FALSE"` and `"TRUE"`,
so rewrite it with real names.
It also drops the `grand` graph attribute, so restore the title with `add_info()`.

**Provenance.** Record what the source states, and nothing more.
`add_info()` recognises `name`, `modes`, `layers`, `directed`, `source`, `method`,
`location`, `date`, `boundary`, `observation`, `update`, and `doi`.
Do not invent a `method`, `boundary`, or `doi` that cannot be checked against
the documentation or the cited source.

**Missing data.** Record an unobserved dyad in `missings`, never as a zero tie
and never as a source's numeric code.
`mpn_cow_trade` once stored the Correlates of War code `-9` as a negative weight,
which made the network read as signed.

### Tests

This package uses the `testthat` package for testing functions.
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/pushrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,26 @@ jobs:
echo "Renamed files"
ls migraph_*

- name: Extract release notes from NEWS.md
shell: bash
run: |
# Take the NEWS.md section for this version, else the topmost section.
awk -v ver="${{ env.PACKAGE_NAME }} ${{ env.PACKAGE_VERSION }}" '
/^# / { if (found) exit; if (substr($0, 3) == ver) { found = 1; next } }
found { print }
' NEWS.md > RELEASE_NOTES.md
if [ ! -s RELEASE_NOTES.md ]; then
awk 'NR > 1 && /^# / { exit } NR > 1 { print }' NEWS.md > RELEASE_NOTES.md
fi
cat RELEASE_NOTES.md

- name: Create Release and Upload Assets
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.newtag.outputs.tag }}
name: Release ${{ steps.newtag.outputs.tag }}
body_path: RELEASE_NOTES.md
draft: false
prerelease: false
fail_on_unmatched_files: true
Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: migraph
Title: Inferential Methods for Multimodal and Other Networks
Version: 1.6.9
Version: 1.7.0
Description: A set of tools for testing networks.
It includes functions for univariate and multivariate conditional uniform graph
and quadratic assignment procedure testing, and network regression.
Expand All @@ -18,8 +18,8 @@ Encoding: UTF-8
LazyData: true
Depends:
R (>= 4.1.0),
manynet (>= 2.2.1),
autograph (>= 1.1.1),
manynet (>= 2.3.1),
autograph (>= 1.2.2),
netrics (>= 0.4.0)
Imports:
dplyr (>= 1.1.0),
Expand Down
52 changes: 52 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,55 @@
# migraph 1.7.0

## Package

- Raised the minimum versions of the stocnet dependencies: manynet 2.3.1 and autograph 1.2.2
- Updated CONTRIBUTING
- Fixed the attach-time version check by parsing version strings with `package_version()`

## Models

- Fixed `play_diffusions()` for `stocnet` input via initial coercion (re stocnet/manynet#172)

## Data

- Converted every `mpn_*` dataset to the `stocnet` class, in line with `{manynet}`
- Removed the `weight` tie attribute from the datasets that are not weighted
- Merged `mpn_cow`
- This combines interstate trade and IGO membership into one multilevel network
of 116 "states" and 40 "IGOs", with `trade` and `membership` tie layers
- `mpn_cow_trade` and `mpn_cow_igo` are retained, because `{manynet}` currently
reads a network with two named modes as undirected, which symmetrises the
trade layer of `mpn_cow`, and because `to_layer()` does not recover that layer
either (stocnet/manynet#170, stocnet/manynet#171)
- Fixed `mpn_cow_trade` missing-data coding from `-9` (759 cells) to `NA`
- Added a `scope` node attribute to the IGOs in `mpn_cow` and `mpn_cow_igo`,
recording whether an organisation is `"global"` or `"regional"`
- Merged `mpn_senate`
- This combines the 112th Congress data into one multilevel network
of 93 senators, 78 PACs, and 25 bills
- `mpn_senate_dem` and `mpn_senate_rep` are not party networks but
record two communities of one network and their intersection;
the `community` node attribute holds `"A"`, `"B"`, or `"both"`
- Cells that neither community covers were never observed, and are recorded as
missing rather than as absent ties
- Where the two communities disagree, in 9 of their 640 shared cells,
community A governs, since it agrees with the overlap file in all 640
- `mpn_senate_dem`, `mpn_senate_rep`, and `mpn_senate_over` are deprecated and
will be removed in 1.8.0
- Merged `mpn_evs_ita`, `mpn_evs_deu`, and `mpn_evs_gbr`
- These combine each country's European Values Study data for 1990 and 2008 into one two-mode network,
with the year recorded in the `time` tie attribute
- These are repeated cross-sections, not a panel, so use `over_time()` not `over_waves()`
- The six year-by-country datasets are deprecated and will be removed in 1.8.0
- Converted `mpn_elite_mex`
- Converted `mpn_elite_usa_advice`
- It now names its two modes, `"directors"` and `"think tanks"`
- Converted `mpn_elite_usa_money`
- It now names its three modes, `"elites"`, `"organisations"`, and `"candidates"`
- Converted `mpn_bristol`
- It now names its three modes, `"individuals"`, `"organisations"`, and `"events"`
- Converted `mpn_ryanair`

# migraph 1.6.9

## Package
Expand Down
Loading
Loading