| Title: | Knit Network Map for any Dataset |
|---|---|
| Description: | Designed to create interactive and visually compelling network maps using R Shiny. It allows users to quickly analyze CSV files and visualize complex relationships, structures, and connections within data by leveraging powerful network analysis libraries and dynamic web interfaces. |
| Authors: | Jayachandra N [aut, cre], Pushker Ravindra [aut] |
| Maintainer: | Jayachandra N <[email protected]> |
| License: | GPL-3 |
| Version: | 0.2.1 |
| Built: | 2026-06-10 07:38:22 UTC |
| Source: | https://github.com/cran/netknitr |
Generates network map using the nodes and edges objects generated by getNodes and getEdges functions respectively.
createVisNetwork( nodes, edges, background = "lightblue", border = "darkblue", highlight = "yellow" )createVisNetwork( nodes, edges, background = "lightblue", border = "darkblue", highlight = "yellow" )
nodes |
Nodes. |
edges |
Edges. |
background |
Background color. |
border |
Border color. |
highlight |
Highlight color. |
Network map visualization
Jayachandra N
nodes <- getNodes(head(mtcars), c("cyl", "gear", "vs"), group = TRUE) res <- fixNodeBias(head(mtcars)) edges <- getEdges(getAssociation(res), getNodes(res, group = TRUE)) createVisNetwork(nodes, edges)nodes <- getNodes(head(mtcars), c("cyl", "gear", "vs"), group = TRUE) res <- fixNodeBias(head(mtcars)) edges <- getEdges(getAssociation(res), getNodes(res, group = TRUE)) createVisNetwork(nodes, edges)
Fix the possible bias that occurs while generating the nodes.
fixNodeBias(my_data)fixNodeBias(my_data)
my_data |
data frame |
data frame
Jayachandra N
res <- fixNodeBias(head(mtcars))res <- fixNodeBias(head(mtcars))
Determine the associations between the values of different columns within the input data frame crude_data.
getAssociation(crude_data)getAssociation(crude_data)
crude_data |
data frame to get associations between the values of different columns |
data frame of edges indicating from and to nodes
Jayachandra N
getAssociation(head(mtcars))getAssociation(head(mtcars))
Generate edges or lines data frame which defines the link between nodes.
getEdges(polished_data, nodes)getEdges(polished_data, nodes)
polished_data |
data frame, output of getAssociation function |
nodes |
data frame, output of getNodes function |
data frame of edges indicationg from and to node ids
Jayachandra N
res <- fixNodeBias(head(mtcars)) edges <- getEdges(getAssociation(res), getNodes(res, group = TRUE))res <- fixNodeBias(head(mtcars)) edges <- getEdges(getAssociation(res), getNodes(res, group = TRUE))
Generate nodes for the input data frame, returns data frame of possible nodes and its IDs for the further process.
getNodes(crude_data, columns_for_nodes = NULL, group = FALSE)getNodes(crude_data, columns_for_nodes = NULL, group = FALSE)
crude_data |
Data Frame that you want to build a network for. |
columns_for_nodes |
Vector of column names for crude_data, works well for at least 3 columns |
group |
Logical value, set TRUE to differentiate nodes by shapes and colors. Default value is FALSE |
Data frame, each unique item is a node and associated with unique id
Jayachandra N
getNodes(head(mtcars), c("cyl", "gear", "vs"), group = TRUE)getNodes(head(mtcars), c("cyl", "gear", "vs"), group = TRUE)
Generate shapes for the given nodes, shapes can be defined using the shapes otherwise defaults to null.
getShapes(nodes, shapes = NULL)getShapes(nodes, shapes = NULL)
nodes |
nodes data, output of getNodes function |
shapes |
character vector indicating manual shapes to choose for nodes |
a vector of shapes which is ready to cbind with nodes data
Jayachandra N
nodes <- getNodes(head(mtcars), c("cyl", "gear", "vs"), group =TRUE) nodes$shape <- getShapes(nodes)nodes <- getNodes(head(mtcars), c("cyl", "gear", "vs"), group =TRUE) nodes$shape <- getShapes(nodes)
Run inbuilt R shiny app.
knitNet()knitNet()
shiny ui page
Jayachandra N
knitNet()knitNet()
Read input files including .csv, .xlsx and .txt files in tabular format and return as data.frame.
readMyFile(this_file)readMyFile(this_file)
this_file |
File path |
data.frame, content of the file.
Jayachandra N
temp_file <- tempfile(fileext = ".csv") write.csv(mtcars, temp_file) readMyFile(temp_file)temp_file <- tempfile(fileext = ".csv") write.csv(mtcars, temp_file) readMyFile(temp_file)