Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checkEvents() method addresses S3 generic/method consistency #91

Merged
merged 1 commit into from
Apr 11, 2024
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
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 1.6.6
Date: 2024-03-13 11:10:49 UTC
SHA: 7057fa002354262151936b3d73c53a6d9f474b0c
Version: 1.6.7
Date: 2024-04-11 11:53:04 UTC
SHA: 859b5bcfafb03bd44ce97a810673b5fd943d92ef
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Encoding: UTF-8
Package: goldfish
Type: Package
Title: Statistical Network Models for Dynamic Network Data
Version: 1.6.7
Version: 1.6.8
Date: 2024-04-11
Authors@R: c(person("James", "Hollway", role = c("aut", "dtc"),
email = "[email protected]",
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# goldfish 1.6.8

* `checkEvents()` method addresses S3 generic/method consistency.
* Solves broken link in the bibliography.

# goldfish 1.6.7

* Debug and update yaml workflow files for GitHub Actions.
Expand Down
19 changes: 12 additions & 7 deletions R/functions_checks.R
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ checkDependentEvents <- function(events, eventsName, nodes, nodes2,
tryCatch(
{
checkEvents(
nodes, events, eventsName,
object = nodes, events = events, eventsName = eventsName,
updateColumn = updateColumn,
environment = environment
)
Expand All @@ -498,8 +498,10 @@ checkDependentEvents <- function(events, eventsName, nodes, nodes2,
} else if (all(c("sender", "receiver") %in% names(events))) {
tryCatch(
{
checkEvents(defaultNetwork, events, eventsName, nodes, nodes2,
updateColumn = updateColumn, environment = environment
checkEvents(
object = defaultNetwork, events = events, eventsName = eventsName,
updateColumn = updateColumn, environment = environment,
nodes = nodes, nodes2 = nodes2
)
},
error = function(e) {
Expand Down Expand Up @@ -552,7 +554,9 @@ checkGlobalAttribute <- function(global) {
# IF it's associated to a network
# - a column "replace" OR "increment" of characters or numerics or booleans

checkEvents <- function(object, ...) {
checkEvents <- function(
object, events, eventsName,
updateColumn = TRUE, environment = environment(), ...) {
UseMethod("checkEvents", object)
}

Expand All @@ -567,7 +571,8 @@ checkEvents <- function(object, ...) {

checkEvents.nodes.goldfish <- function(
object, events, eventsName,
attribute = NULL, updateColumn = TRUE, environment = environment()) {
updateColumn = TRUE, environment = environment(),
attribute = NULL, ...) {
# check attributes
if (!is.data.frame(events)) stop("An event list should be a data frame.")
if (!is.null(attribute)) {
Expand Down Expand Up @@ -710,8 +715,8 @@ checkEvents.nodes.goldfish <- function(

checkEvents.network.goldfish <- function(
object, events, eventsName,
nodes, nodes2 = NULL,
updateColumn = TRUE, environment = environment()) {
updateColumn = TRUE, environment = environment(),
nodes, nodes2 = NULL, ...) {
# get data frames of presence events over the nodes sets
isTwoMode <- !is.null(nodes2)
nodesName <- c(
Expand Down
6 changes: 4 additions & 2 deletions R/functions_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,8 @@ linkEvents.nodes.goldfish <- function(x, changeEvents, attribute, ...) {
{
checkEvents(
object = x, events = changeEvents, eventsName = objEventCurr,
attribute = attribute, environment = linkEnvir
environment = linkEnvir,
attribute = attribute
)
},
error = function(e) {
Expand Down Expand Up @@ -954,7 +955,8 @@ linkEvents.network.goldfish <- function(x, changeEvents,
{
checkEvents(
object = x, events = changeEvents, eventsName = objEventCurr,
nodes = nodes, nodes2 = nodes2, environment = linkEnvir
environment = linkEnvir,
nodes = nodes, nodes2 = nodes2
)
},
error = function(e) {
Expand Down
5 changes: 4 additions & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@

## R CMD check results

0 errors | 0 warnings | 0 note
0 errors | 0 warnings | 1 note

* This is a new release.
* `checkEvents()` method addresses S3 generic/method consistency.
2 changes: 1 addition & 1 deletion inst/REFERENCES.bib
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ @article{Stadtfeld2017Coordination
number = {1},
pages = {1-40},
year = {2017},
doi = {10.1177/0081175017703776},
doi = {10.1177/0081175017709295},
url = {https://doi.org/10.1177/0081175017709295}
}

Expand Down
Loading