# NOT RUN {
# }
# NOT RUN {
set.seed(12345);
create.histogram(
filename = paste0(tempdir(),'/Histogram_Simple.tiff'),
x = rnorm(5000),
main = 'Simple',
description = 'Histogram created by BoutrosLab.plotting.general'
);
create.histogram(
filename = paste0(tempdir(),'/Histogram_Simple_Count.tiff'),
x = rnorm(5000),
main = 'Simple Count',
description = 'Histogram created by BoutrosLab.plotting.general',
type = 'count'
);
# Minimal Input
create.histogram(
filename = paste0(tempdir(),'/Histogram_Minimal_Input.tiff'),
x = microarray[,1],
main = 'Minimal input',
description = 'Histogram created by BoutrosLab.plotting.general'
);
# Formula Input - dividing by chromosome
chr.data <- data.frame(
x = microarray$Chr,
y = microarray[,1]
);
create.histogram(
filename = paste0(tempdir(),'/Histogram_Formula_Input.tiff'),
x = y ~ x,
data = chr.data,
main = 'Formula input',
description = 'Histogram created by BoutrosLab.plotting.general'
);
# Axes and Labels
create.histogram(
filename = paste0(tempdir(),'/Histogram_Axes_Labels.tiff'),
x = microarray[,1],
main = 'Axes & labels',
# Customizing the axes and labels
xlab.label = 'Bins',
ylab.label = 'Counts',
xlimits = c(0, 16),
xat = seq(0,15,5),
# set break points for bins
breaks = seq(floor(min(microarray[,1])), ceiling(max(microarray[,1])), 1),
description = 'Histogram created by BoutrosLab.plotting.general'
);
# Colour change
create.histogram(
filename = paste0(tempdir(),'/Histogram_Colours.tiff'),
x = microarray[,1],
main = 'Colours',
xlab.label = 'Bins',
ylab.label = 'Counts',
xlimits = c(0, 16),
xat = seq(0,15,5),
breaks = seq(floor(min(microarray[,1])), ceiling(max(microarray[,1])), 1),
# Colours
col = 'lightgrey',
description = 'Histogram created by BoutrosLab.plotting.general'
);
# Line type
create.histogram(
filename = paste0(tempdir(),'/Histogram_Line_Type.tiff'),
x = microarray[,1],
main = 'Line type',
xlab.label = 'Bins',
ylab.label = 'Counts',
xlimits = c(0, 16),
xat = seq(0,15,5),
breaks = seq(floor(min(microarray[,1])), ceiling(max(microarray[,1])), 1),
col = 'lightgrey',
# Changing the line type
lty = 2,
description = 'Histogram created by BoutrosLab.plotting.general'
);
# Nature style
create.histogram(
filename = paste0(tempdir(),'/Histogram_Nature_style.tiff'),
x = microarray[,1],
main = 'Nature style',
xlimits = c(0, 16),
xat = seq(0,15,5),
breaks = seq(floor(min(microarray[,1])), ceiling(max(microarray[,1])), 1),
col = 'lightgrey',
# set style to Nature
style = 'Nature',
# demonstrating how to italicize character variables
ylab.label = expression(paste('italicized ', italic('a'))),
# demonstrating how to create en-dashes
xlab.label = expression(paste('en dashs: 1','\u2013', '10'^'\u2013', ''^3)),
description = 'Histogram created by BoutrosLab.plotting.general'
);
# }
Run the code above in your browser using DataCamp Workspace