-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample.R
41 lines (37 loc) · 1.1 KB
/
example.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
packages <- c('data.tree')
if (length(setdiff(packages, rownames(installed.packages()))) > 0) {
install.packages(setdiff(packages, rownames(installed.packages())))
}
library(data.tree)
S <- Node$new('S')
I <- S$AddChild('I')
H <- S$AddChild('H')
P <- S$AddChild('P')
U <- S$AddChild('U')
P2 <- U$AddChild('P')
H3 <- P2$AddChild('H')
G3 <- P2$AddChild('G')
L3 <- P2$AddChild('L')
E3 <- P2$AddChild('E')
R3 <- E3$AddChild('R')
L2 <- U$AddChild('L')
E2 <- U$AddChild('E')
O2 <- U$AddChild('O')
R2 <- U$AddChild('R')
N2 <- U$AddChild('N')
T2 <- U$AddChild('T')
T <- S$AddChild('T')
print(S)
Dict <- Node$new('Dictionary')
SUP <- Dict$AddChild('SUP')
SUPER <- SUP$AddChild('SUPER')
SUPPER <- SUP$AddChild('SUPPER')
SUPPOSE <- SUP$AddChild('SUPPOSE')
SUPPOSED <- SUP$AddChild('SUPPOSED')
SUPPORT <- SUP$AddChild('SUPPORT')
SUPRISE <- SUP$AddChild('SUPRISE')
TRI <- Dict$AddChild('TRI')
TRINITY <- TRI$AddChild('TRINITY')
TRIP <- TRI$AddChild('TRIP')
TRIPOD <- TRI$AddChild('TRIPOD')
print(Dict)