Package 'visNICE'

Title: Visualise NICE Guidance Documents in a Network
Description: Plots networks and subnetworks with NICE documents organised in a hierarchy.
Authors: J Matthews [aut, cre, cph]
Maintainer: J Matthews <[email protected]>
License: GPL (>= 3)
Version: 1.0.0
Built: 2026-11-26 03:19:51 UTC
Source: https://github.com/cran/visNICE

Help Index


take a cutting from a tree (object of class nicetree)

Description

A subtree is formed with the specified node at the root. This is a 'cutting': all nodes that are not descendents of the specified node are eliminated. The function returns a (smaller) tree (object of class nicetree), with the specified node as the root.

Usage

## S4 method for signature 'nicetree'
cutting(h, nodelabel = NULL)

Arguments

h

an object of class nicetree

nodelabel

node of interest

Value

object of class nicetree

Examples

h <- nicetree()
(h)
subh <- cutting(h, "CANCER")
(subh)

constructor for nicetree objects

Description

constructor for nicetree objects

Usage

nicetree()

Details

make a nicetree

Value

an object of class nicetree

Examples

h <- nicetree()

class to represent a tree for nice hierarchy

Description

class to represent a tree for nice hierarchy

Slots

node

node id

pnode

parent node id

lab

doc code

plab

parent doc code

text

nice textual info

drugnames

common names for drugs where known

lev

level of each node (root node is 0)

Nnode

number of nodes in the tree excluding root node

Nlev

number of levels in the tree excluding root node

doctype

NICE document type


plot the tree as a network graph

Description

plot the tree as a network graph

Usage

## S4 method for signature 'nicetree'
plot(
  x,
  circle = TRUE,
  add_text = FALSE,
  leaf_label = FALSE,
  stem_label = TRUE,
  include_names = FALSE,
  text_size = 10,
  text_angle = 45,
  width = 500,
  height = 500,
  hover_msg = TRUE
)

Arguments

x

a tree (object of class nicetree)

circle

whether or not to arrange graph over a circle

add_text

whether or not to label with textual info

leaf_label

whether or not leaf nodes will be labelled

stem_label

whether or not stem nodes will be labelled

include_names

whether or not to include common names in text

text_size

annotation text size

text_angle

annotation text angle

width

graph width

height

graph height

hover_msg

whether to remind the user that they can hover over nodes

Details

plots an object of class nicetree as a network, with some display options. Users can hover over nodes to display textual information that would otherwise clutter up the graph.

Value

object of class plotly

Examples

h <- nicetree()
cutting(h, "SKINCO") |> plot()

summarise nicetree object

Description

Prints to console the number of nodes and levels and a cross-table, excluding the root node. Also prints the root node and names of the first layer in the tree (children of the root node).

Usage

## S4 method for signature 'nicetree'
show(object)

Arguments

object

of class nicetree

Value

prints summary to console

Examples

h <- nicetree()
(h)