Skip to content
/ dir2json Public

JSON representation of hierarchical data, such as a directory structure

Notifications You must be signed in to change notification settings

stla/dir2json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dir2json, an R package

Originally, this package only dealt with the hierarchical data given by the structure of a folder, but now it can deal with any dataset with a hierarchical structure. It provides a Shiny application (see below). Also provides a function to get the tree view of a directory.

This package uses the DLL created by the Haskell libraries jsondirtree and jsondirtreeR. They are standalone on Windows.

library(dir2json)
dat <- tibble::tribble(
  ~level1, ~level2, ~level3, ~level4, 
  "Beverages", "Water", "", "", 
  "Beverages", "Coffee", "", "", 
  "Beverages", "Tea", "Black tea", "", 
  "Beverages", "Tea", "White tea", "", 
  "Beverages", "Tea", "Green tea", "Sencha", 
  "Beverages", "Tea", "Green tea", "Gyokuro", 
  "Beverages", "Tea", "Green tea", "Matcha", 
  "Beverages", "Tea", "Green tea", "Pi Lo Chun"
)
shinyDataTree(dat, root = FALSE)

This kind of tree is called a Reingold-Tilford tree network diagram. It is produced with the help of D3.js.

About

JSON representation of hierarchical data, such as a directory structure

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published