# Mon Dec 14 11:46:26 2020 -
# 字符编码:UTF-8
# R 版本:R x64 4.0.3 for window 10
# cgh163email@163.com
# 个人笔记不负责任
# —— 拎了个梨🍐
.rs.restartR()
require(jsTree)
rm(list=ls());gc()
data(states)
data(state_bird)
#collapse columns to text (with sep "/")
nested_string <- apply(states,1,paste,collapse='/')
jsTree(nested_string)
#pass additional parameters to core
jsTree(nested_string,core=list(multiple=FALSE))
# Add tooltips to state names with the state bird
jsTree(nested_string,tooltips = state_bird)
#initialize tree with checked boxes for certain fields
nodestate1 <- states$variable=='Area'
jsTree(nested_string,nodestate=nodestate1)
nodestate2 <- states$variable=='Area'&grepl('^M',states$state.name)
jsTree(nested_string,nodestate=nodestate2)
nodestate3 <- states$variable %in% c('Murder') & states$value >= 10
nodestate4 <- states$variable %in% c('HS.Grad') & states$value <= 55
jsTree(nested_string,nodestate=nodestate3|nodestate4)
#change the order of the hierarchy
nested_string2 <- apply(states[,c(4,1,2,3,5)],1,paste,collapse='/')
jsTree(nested_string2)
#use jsTree to visualize folder structure
jsTree(list.files(full.names = TRUE,recursive = FALSE))
## Not run:
# This may be too long for example if running from ~.
jsTree(list.files(full.names = TRUE,recursive = TRUE))
# Mon Dec 14 11:51:27 2020 --diy----------------------------
# 字符编码:UTF-8
# R 版本:R x64 4.0.3 for window 10
# cgh163email@163.com
# 个人笔记不负责任
# —— 拎了个梨🍐
.rs.restartR()
require(jsTree)
library(tidyr)
rm(list=ls());gc()
jsTree(runif(10,1,90) %>% as.character())
# Mon Dec 14 11:51:48 2020 --
#
dt <- read.csv('cgh,演示数据.csv')
dt1 <- unite(dt,'a',Class,c,sep = '/')
jsTree(dt1$a)
R语言jsTree包,文件树
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 一、xlsx 包介绍 虽然平时处理的文件一般都是txt 、csv文件,但其可读性不如xlsx文件,在给别人展示你的...
- R语言leafem包,addGeotiff函数,将GeoTIFF文件直接叠加到活页地图
- 原文链接[http://www.ikeguang.com/?p=182] R语言可以读取很多文件,其中以txt文本...