| CARVIEW |
Select Language
HTTP/2 200
server: GitHub.com
content-type: text/html; charset=utf-8
last-modified: Tue, 31 Oct 2023 10:37:00 GMT
access-control-allow-origin: *
etag: W/"6540d8cc-1fa6e"
expires: Sun, 18 Jan 2026 10:20:09 GMT
cache-control: max-age=600
content-encoding: gzip
x-proxy-cache: MISS
x-github-request-id: 4D97:3BCF0D:1CA1DB:21D89F:696CB180
accept-ranges: bytes
age: 0
date: Sun, 18 Jan 2026 10:10:09 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210089-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1768731009.081554,VS0,VE224
vary: Accept-Encoding
x-fastly-request-id: c429e322d8b2965da2b412e2c37d6704935eaf2d
content-length: 13354
CART
Since visNetwork_2.0.0, you can visualize Classification and Regression Trees from the output of the rpart package, simply using
Since visNetwork_2.0.0, you can visualize Classification and Regression Trees from the output of the rpart package, simply using visTree :
Classification Tree
library(rpart)
# Basic classification tree
res <- rpart(Species~., data=iris)
visTree(res, main = "Iris classification Tree", width = "100%")
Regression tree
res <- rpart(Petal.Length~., data=iris)
visTree(res, edgesFontSize = 14, nodesFontSize = 16, width = "100%")
data("solder")
res <- rpart(Opening~., data = solder, control = rpart.control(cp = 0.00005))
visTree(res, height = "800px", nodesPopSize = TRUE, minNodeSize = 10,
maxNodeSize = 30, width = "100%")
Use in shiny
Have a look at visTreeEditor to edit and get back to the network, and at visTreeModuleServer to use custom tree module in R.