Skip to content

fix: added NA handling for matrix inputs #1828

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

schochastics
Copy link
Contributor

@schochastics schochastics commented Apr 16, 2025

Fix #917
Fix #918

This PR introduces an error message if inputs to

  • graph_from_adjacency_matrix()
  • graph_from_biadjacency_matrix()
  • graph_from_edgelist()
  • graph_from_data_frame()

contains NAs

Copy link
Contributor

aviator-app bot commented Apr 16, 2025

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This pull request is currently open (not queued).

How to merge

To merge this PR, comment /aviator merge or add the mergequeue label.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

Copy link
Contributor

@krlmlr krlmlr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, great! Should we do another round here?

@krlmlr
Copy link
Contributor

krlmlr commented Apr 29, 2025

Has conflicts too.

@szhorvat
Copy link
Member

FYI I've been working on NaN passthrough for the adj. mat. functions in the C core, which would preserve NA values.

@schochastics
Copy link
Contributor Author

FYI I've been working on NaN passthrough for the adj. mat. functions in the C core, which would preserve NA values.

@szhorvat Whats the use case you have in mind? Working with missing data? Is it still ok to kick it out here?

@szhorvat
Copy link
Member

szhorvat commented Apr 29, 2025

Original motivation was to support the R interface better. On the C side we don't try to distinguish between different types of NaNs, but if we pass through NaNs untouched, then the NaN/NA distinction survives for R. We don't have to do it if you don't think it's important.

If you do think it's useful, should should still go ahead with this PR. The requirements can be relaxed in the future, we can still do it.

@schochastics
Copy link
Contributor Author

I think for now NAs should through errors. But I have been thinking about how to use NAs for missing values in network data (when data was gathered and there is non-response). It is a very practical, non graph-theoretic problem but important in SNA. I gotta check how people currently deal with it. But that is a task for a day when the interface is clean(ish)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants