Skip to content

fix: get_edge_ids() error for 2x2 matrices #1798

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

schochastics
Copy link
Contributor

The function now throws a warning and indicates how the matrix is interpreted for backward compatibility

Copy link
Contributor

aviator-app bot commented Apr 4, 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.

@schochastics schochastics requested a review from krlmlr April 4, 2025 15:38
@krlmlr
Copy link
Contributor

krlmlr commented Apr 4, 2025

I see that only three packages are affected: corpustools, mwcsr and SEMID. One of the results also hints at a misuse from igraph itself. I still think we should break cleanly and perhaps improve the error message.

@krlmlr
Copy link
Contributor

krlmlr commented Apr 4, 2025

Another alternative: disallow matrices altogether, ask users to convert matrices with c() or to pass data frames if they have data in columns.

@schochastics
Copy link
Contributor Author

Fine by me, lets find a way in this PR

@schochastics schochastics changed the title fix: get_edge_ids() throws warning instead of error for 2x2 matrices fix: get_edge_ids() error for 2x2 matrices Apr 4, 2025
@schochastics schochastics marked this pull request as draft April 5, 2025 17:46
@krlmlr
Copy link
Contributor

krlmlr commented Apr 10, 2025

Let's await revdepchecks in #1793.

"2.1.5",
"get_edge_ids(vp = 'is not allowed to be a 2 times 2 matrix')"
"get_edge_ids(vp = 'is not allowed to be a 2 times 2 matrix')",
details = c("For backward compatibility, edges are interpreted columnwise.", "convert to a data.frame with two columns and one row per edge.")
Copy link
Contributor

Choose a reason for hiding this comment

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

The second message (one row per edge) is clearer. Could the two be combined? My suggestion below is very bad though.

Suggested change
details = c("For backward compatibility, edges are interpreted columnwise.", "convert to a data.frame with two columns and one row per edge.")
details = c("For backward compatibility, it is assumed that each row is an edge, from the first column to the second column.", "convert to a data.frame with two columns and one row per edge.")

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

Successfully merging this pull request may close these issues.

3 participants