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

Improve error messages when missing data is presence in data objects #82

Open
auzaheta opened this issue Nov 17, 2022 · 0 comments
Open
Assignees

Comments

@auzaheta
Copy link
Collaborator

Thanks to Fanny Mignon for reporting this issue.

Is your feature request related to a problem? Please describe.
Missing data in the data objects produces errors when linking to a nodes data frame or a network matrix. A better message would help identify the problem.

data("Fisheries_Treaties_6070")

states <- defineNodes(states)
# introduce missing data on time-stamps
sovchanges$time[5] <- NA
states <- linkEvents(states, sovchanges, attribute = "present")
> Error in linkEvents(states, sovchanges, attribute = "present") : 
> The events couldn't be added: missing value where TRUE/FALSE needed

# introduce missing data on node
regchanges$node[5] <- NA_character_
states <- linkEvents(states, regchanges, attribute = "regime")
> Error in linkEvents(states, regchanges, attribute = "regime") : 
> The events couldn't be added: Nodes labels for the attributeregimeare incorrect.

# introduce missing data on time-stamps
bilatchanges$time[5] <- NA
bilatnet <- defineNetwork(bilatnet, nodes = states, directed = FALSE)
bilatnet <- linkEvents(bilatnet, bilatchanges, nodes = states)

> Error in linkEvents(bilatnet, bilatchanges, nodes = states) : 
> The events couldn't be added: missing value where TRUE/FALSE needed

# introduce missing data on sender or receiver
contigchanges$sender[5] <- NA_character_
contignet <- defineNetwork(contignet, nodes = states, directed = FALSE)
contignet <- linkEvents(contignet, contigchanges, nodes = states)

> Error in linkEvents(contignet, contigchanges, nodes = states) : 
> The events couldn't be added: missing value where TRUE/FALSE needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant