-
Notifications
You must be signed in to change notification settings - Fork 41
Description
In data.tree version 1.1.0 (installed from CRAN, and also observed when installing from GitHub), the FindNode method on Node objects appears to be unavailable. Node_instance$FindNode evaluates to NULL, is.function(Node_instance$FindNode) is FALSE, and "FindNode" is not listed in names(data.tree::Node$public_methods). This makes a core piece of functionality unusable.
The issue has been reproduced on multiple machines with different R versions and operating systems:
Linux (Ubuntu 22.04.3 LTS, R 4.3.1)
Windows (R 4.5.x, based on library paths)
Steps to Reproduce:
The following minimal R script demonstrates the issue after installing data.tree v1.1.0 from CRAN:
1. Load data.tree
print("Loading data.tree package...")
library(data.tree)
print("data.tree package loaded.")
2. Print package version
print("Version of data.tree package currently loaded:")
current_version <- packageVersion("data.tree")
print(current_version)
3. Create a test Node
print("Creating a new test_node...")
test_node <- Node$new("TestNode")
print("test_node created.")
4. Check the test_node and its FindNode method
if (!is.null(test_node) && inherits(test_node, "Node")) {
print(paste("Class of test_node:", paste(class(test_node), collapse=", ")))
print("Checking test_node$FindNode directly:")
print(test_node$FindNode)
print(paste("Is test_node$FindNode a function?", is.function(test_node$FindNode)))
print("Public methods listed in data.tree::Node$public_methods:")
if (exists("Node", where = "package:data.tree") && !is.null(data.tree::Node$public_methods)) {
print(names(data.tree::Node$public_methods))
} else {
print("Could not access data.tree::Node$public_methods.")
}
} else {
print("test_node could not be created or is not a Node object.")
}
Expected Behavior:
test_node$FindNode should be a function.
is.function(test_node$FindNode) should be TRUE.
FindNode should be listed in names(data.tree::Node$public_methods).
Actual Behavior (Output from the script):
[1] "data.tree package loaded."
[1] "Version of data.tree package currently loaded:"
[1] ‘1.1.0’
[1] "--- Testing data.tree version: 1.1.0 ---" # (Or similar, from my modified script)
[1] "Creating a new test_node..."
[1] "test_node created."
[1] "Class of test_node: Node, R6"
[1] "Checking test_node$FindNode directly:"
NULL
[1] "Is test_node$FindNode a function? FALSE"
[1] "Public methods listed in data.tree::Node$public_methods:"
[1] "initialize" "AddChild" "AddChildNode" "AddSibling" "AddSiblingNode" "RemoveChild" "RemoveAttribute" "Sort" "Revert" "Prune"
[11] "Climb" "Navigate" "Get" "Do" "Set" "clone"
This issue was identified after extensive troubleshooting, including reinstalling the package, installing from CRAN, and installing version 1.1.0 directly from GitHub (remotes::install_github("gluc/data.tree")). The problem (missing FindNode method) was consistent with version 1.1.0 in all scenarios tested.