An Implementation of the Artificial Hydrocarbon Networks


[Up] [Top]

Documentation for package ‘ahnr’ version 0.2.0

Help Pages

AHNnD AHNnD
plot.ahn #' plotAHN #' #' @param ahn a list produced from the AHNnD function. #' #' @return visualization of the AHN. #' @export #' #' @examples #' # Create data #' x <- 2 * runif(1000) - 1; #' x <- sort(x) #' #' y <- (x < 0.1) * (0.05 * runif(100) + atan(pi*x)) + #' (x >= 0.1 & x < 0.6) * (0.05 * runif(1000) + sin(pi*x)) + #' (x >= 0.6) * (0.05 * runif(1000) + cos(pi*x)) #' #' # Create Sigma list #' Sigma <- list(X = data.frame(x = x), Y = data.frame(y = y)) #' #' # Train AHN #' ahn <- AHNnD(Sigma, 5, 0.01, 500) #' #' # Plot AHN #' plotAHN(ahn) #' plotAHN <- function(ahn) vis <- CreateNodesEdges(ahn) graph <- igraph::graph_from_data_frame(vis$edges, directed = FALSE, vertices = vis$nodes) ggraph(graph, layout = 'graphopt') + geom_edge_link(aes(start_cap = label_rect(node1.name), end_cap = label_rect(node2.name))) + geom_node_text(label = vis$nodes$label) + theme_void() Plot Artificial Hydrocarbon Network
SimAHNnD SimAHNnD
summary.ahn Summary Artificial Hydrocarbon Network