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

cannot create a network data from a matrix using network function #264

Open
kemorkemor opened this issue Feb 7, 2023 · 2 comments
Open
Assignees
Labels
manual Issues about the documentation of DNA and rDNA question rDNA Issues related to rDNA version 3.0 Issues relating to version 3.0, including rDNA
Milestone

Comments

@kemorkemor
Copy link

I'm using rDNA(3.0.9) package on R in order to control dna-3.0.9.jar.

When I try to create network data using sample.dna file according to dna-manual-3(pp.83-4) under the windows 10 circumstances, I got the following error. I would appreciate if somebody could help me with a solution.

congruence <- dna_network(networkType = "onemode",
statementType = "DNA Statement",
variable1 = "organization",
variable2 = "concept",
qualifier = "agreement",
qualifierAggregation = "congruence",
duplicates = "document")
congruence

nw <- network(congruence)


#following comes out:
Error in as.network.matrix(x, directed = directed, hyper = hyper, loops = loops, :
the dimensions of the matrix argument (7 by 7) do not match the network size indicated by the attached n attribute (22), perhaps matrix.type argument is not correct

Thank you in advance.

@leifeld
Copy link
Owner

leifeld commented Feb 7, 2023

Where did you find a manual for version 3? I think we only have one for version 2 at the moment.

I think the problem may arise because in version 3 of rDNA, networks are saved as matrices with some additional attributes and a new class label for one- or two-mode network matrices. When you try statnet's as.network function, this function expects a matrix, not a DNA network matrix. You can cast the object into a matrix using as.matrix before you hand it over to as.network.

Can you try it and let me know if this fixes your problem?

The documentation hasn't kept up with the development, unfortunately, but I will try to rectify this some time later this year.

@leifeld leifeld self-assigned this Feb 7, 2023
@leifeld leifeld added question rDNA Issues related to rDNA manual Issues about the documentation of DNA and rDNA version 3.0 Issues relating to version 3.0, including rDNA labels Feb 7, 2023
@leifeld leifeld added this to the DNA 3.0.10 milestone Feb 7, 2023
@kemorkemor
Copy link
Author

Thank you for your comment. I am a new-bee and was perplexed when I used rDNA after having created and coded my DNA data with ver.3.09. Now I have carefully read your instructions and found out the issue.

I have fixed my problem with statnet's as.network function. Thank you very much for your advice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
manual Issues about the documentation of DNA and rDNA question rDNA Issues related to rDNA version 3.0 Issues relating to version 3.0, including rDNA
Projects
None yet
Development

No branches or pull requests

2 participants