# Tutorial for creating a simple pie chart.
# This tutorial creates a pie chart showing the percentages of different elements in the human genome.
# Note that the data are created in the tutorial not imported from an existing file.
# First, set up the slices for the pie. These are percentages of different elements in the genome.
slices<-c(1.5, 5, 20, 15, 14, 44)
# Second, create the labels for the chart slices.
lbls<-c("Exons (1.5-2%)", "Regulatory seq. (5%)", "Introns (20%)", "Unique noncoding DNA (15%)", "Repetitive DNA (14%)", "Transposable elements (44%)")
# Finally, create the pie chart using the pie command.
# The "col = rainbow" command sets up a non-standard color scheme.
pie(slices, labels = lbls, main="Content of the Human Genome", radius=1, col = rainbow(length(slices)))
