Skip to content

Please issue a warning in FromDataFrameNetwork() when it deletes duplicates #181

@telenskyt

Description

@telenskyt

The function FromDataFrameNetwork() deletes duplicated nodes silently without issuing a warning, even when check = "check", which, according to the documentation:

"check": if the name conformance should be checked and warnings should be printed in case of non-conformance (the default)

But currently it doesn't print any warnings, see:

library(data.tree)

d <- data.frame(node = c("a", "b", "c", "a"), parent = c("/", "a", "a", "/"))
d

  node parent
1    a      /
2    b      a
3    c      a
4    a      /

x <- FromDataFrameNetwork(d, check = "check") # no warnings printed
print(x)

     levelName
1              
2  ¦--a        
3  ¦   ¦--b    
4  ¦   ¦   °--c
5  ¦   °--d    
6  °--b 

The duplicated node "a" was silently removed without warnings. I believe this warning should be printed out, because now I missed this problem in my data and then my other workaround didn't work (#179).

Tested on data.tree package version 1.2.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions