general.bar_plot_simple: Function to create a simple barplot

Description Usage Arguments Value Author(s) Examples

Description

Function to create a simple barplot

Usage

1
2
3
4
5
general.bar_plot_simple(freq, labels = NULL, labels.ab = NULL, file.name,
  col = "tomato3", cex.lab = 1, cex.lab.ab = 1, cex.x = 1, xlab = "",
  ylab = "Frequency", add.legend = FALSE, leg.lab = NULL,
  leg.col = NULL, leg.title = NULL, mar = c(5, 4, 3, 1), png.width = 6,
  png.height = 5)

Arguments

freq

vector with the bar heights, e.g. a frequency table ('table()' output), names will be used for bar labels if 'labels' is not specified

labels

bar labels (default=NULL)

labels.ab

additional labels, which are placed above the bars (default=NULL)

file.name

name for the PNG output file (without '.png' ending)

col

color for the bars (default='tomato3'). if more than one color is specified,

cex.lab

size of the bar labels (default=1)

cex.lab.ab

size of the bar labels above the bars (default=1)

cex.x

size of the x-labels (default=1)

xlab

label for the x-axis (default=”)

ylab

label for the y-axis (default='Frequency')

add.legend

TRUE/FALSE should a legend be added underneath the plot only works if legend parameters are specified (default=TRUE)

leg.lab

labels for the legend (default=NULL)

leg.col

colors for the legend (default=NULL)

leg.title

title for the legend (default=NULL)

mar

plot margin (default=c(5,4,3,1))

png.width

width of the PNG-file in inches (default=6)

png.height

height of the PNG-file in inches (default=5)

Value

PNG file with the barplot ('file.name.png') and a numeric vector with size of the PNG-file in inches for rescaling in RTF

Author(s)

Sebastian Voss, Adam Skubala

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
set.seed(42)
x <- sample(1:30, size=500, replace=TRUE)
freq <- table(x)

general.bar_plot_simple(freq, labels.ab=1:30, file.name="test", 
                col=rep(c('tomato3','tomato3','skyblue2'), 10), 
                cex.lab=.7, cex.lab.ab=.8, cex.x=.9,
                ylab="Bar Height", 
                add.legend=TRUE, leg.title="Color",
                leg.lab=c('red','blue'), leg.col=c('tomato3','skyblue2'),
                mar=c(4,4,3,1))

## End(Not run)

jhooge/BioViz documentation built on May 19, 2019, 9:28 a.m.