项目作者: yonicd

项目描述 :
R htmlwidget for inspecting heirachal structures with the ‘jQuery’ ‘jsTree’ Plugin.
高级语言: HTML
项目地址: git://github.com/yonicd/jsTree.git
创建时间: 2017-05-31T15:12:46Z
项目社区:https://github.com/yonicd/jsTree

开源协议:Other

下载


CRAN\_Status\_Badge
Project Status: Active - The project has reached a stable, usable
state and is being actively
developed.
downloads
R-CMD-check
pkgdown
Coverage
Status

jsTree

R htmlwidget for inspecting heirachal structures with the ‘jQuery’
‘jsTree’ Plugin.

Installation

  1. #install.packages('jsTree')
  2. remotes::install_github('yonicd/jsTree')

Conventional Use

  1. library(jsTree)
  2. data(states)
  3. data(state_bird)

collapse columns to text (with sep “/”)

  1. nested_string <- apply(states,1,paste,collapse='/')
  2. jsTree(nested_string)

Add tooltips to state names with the state bird

  1. jsTree(nested_string,tooltips = state_bird)

initialize tree with checked boxes for certain fields

  1. nodestate1 <- states$variable=='Area'
  2. jsTree(nested_string,nodestate=nodestate1)
  1. nodestate2 <- states$variable=='Area'&grepl('^M',states$state.name)
  2. jsTree(nested_string,nodestate=nodestate2)
  1. nodestate3 <- states$variable %in% c('Murder') & states$value >= 10
  2. nodestate4 <- states$variable %in% c('HS.Grad') & states$value <= 55
  3. jsTree(nested_string,nodestate=nodestate3|nodestate4)

change the order of the hierarchy

  1. nested_string2 <- apply(states[,c(4,1,2,3,5)],1,paste,collapse='/')
  2. jsTree(nested_string2)

Use other delimiters to define the heirarchy

  1. nested_string <- apply(states,1,paste,collapse='|-|')
  2. jsTree(nested_string,sep = '|-|')

Interacting with remote repositories

Preview a github repo without cloning it

  1. remotes::install_github('yonicd/vcs')
  2. #get repo master branch directory structure
  3. vcs::navigate_remote('tidyverse/ggplot2')

Search text in files of a repo without cloning it