Learn R Programming

RadOnc (version 1.0.5)

plot-methods: Additional Methods for Function plot in Package graphics

Description

These additional methods extend function plot in package graphics, enabling DVH visualization in package RadOnc

Usage

## S3 method for class 'DVH':
plot(x, \dots, plot.type = c("individual", "grouped", "ttest", "wilcox", "bars"))

## S3 method for class 'DVH.list': plot(x, \dots, plot.type = c("individual", "grouped", "ttest", "wilcox", "bars"))

Arguments

x
Can represent either an object of class DVH or DVH.list
...
May contain any number of objects of class DVH or DVH.list. Note that at least one object of either class is required if plot.type = "ttest" or "wilcox".
plot.type
A character string specifying the type of plot to generate, must be one of "individual" (default), "grouped", "ttest", "wilcox" or "bars"

Details

See package vignette and examples (below) for more details about each plotting subtype.

See Also

plot

Examples

Run this code
# plot(x, ..., plot.type="individual")
	OARs <- c("LIVER","STOMACH","DUODENUM")
	cols <- c("red", "darkgreen", "blue")
	plot(johndoe[OARs], col=cols, lty=1:3, legend="topright", legend.labels=OARs, main="OARs")
	
	# plot(x, ..., plot.type="bars")
	plot(janedoe[2:9], plot.type="bars", volume="absolute",dose="relative")
	
	# plot(x, ..., plot.type="grouped")
	plot(c(johndoe["STOMACH"],janedoe["STOMACH"]), #group 1
		c(johndoe[c("CTV","PTV")],janedoe[c("CTV","PTV")]), #group 2
		c(janedoe["LIVER"],johndoe["LIVER"]), #group 3
		c(johndoe["DUODENUM"],janedoe["DUODENUM"]), #group 4
		plot.type="grouped", col=c("orange","green","blue","red"), lwd=2, dose="relative")
		
	# plot(x, ..., plot.type="ttest")
	# OARs <- c("LIVER", "STOMACH", "SMALL_BOWEL")
	# plot(c(johndoe[c("CTV","PTV")],janedoe[c("CTV","PTV")]), #group 1
	#	c(janedoe[OARs],johndoe[OARs]), #group 2
 	#	plot.type="t", col=c("red", "blue"), lty=2, fill.lty=1, main="Target v. OAR t-Test")
 		
	# plot(x, ..., plot.type="wilcox")
	# plot(c(johndoe[c("CTV","PTV")],janedoe[c("CTV","PTV")]), #group 1
	#	c(janedoe[OARs],johndoe[OARs]), #group 2
 	#	plot.type="w", col=c("red", "blue"), lty=2, fill.lty=1, main="Target v. OAR")

Run the code above in your browser using DataLab