You are on page 1of 10

Business Intelligence

G. Mudare

www.belgiumcampus.ac.za
Visualizing data in RIn R

2
www.belgiumcampus.ac.za
Changing the font
• There are (only) three basic built-in fonts in R, but you can load many more with the help of
windowsFonts
• The fonts can be accessed with the family argument
• set this argument in plot (for axis titles), text (for adding text to plots), as well as par (to change
the font permanently for
• all text).
Using windowsFonts, you can use any font that is loaded in Windows

3
www.belgiumcampus.ac.za
Adding to a current plot
• Suppose you have made a plot, and want to add points or lines to the
current plot, without opening a new window

4
www.belgiumcampus.ac.za
Straight lines and text
• To place straight lines on a plot
• Adding text to a plot is achieved with the text function
• You may also use expression as the text to be added

5
www.belgiumcampus.ac.za
Special plots
• There are also a large number of packages that specialize in special
plot types,
• Advanced plots can be constructed with the ggplot2 package
• The ggplot2 package offers an alternative way to produce elegant
graphics in R, one that has been embraced by many R users

6
www.belgiumcampus.ac.za
Scatter plot with varying symbol sizes
• The symbols function is an easy way to pack more information in to a
scatter plot, by providing a way to scale the size of the plotting
symbols to another variable in the dataframe

7
www.belgiumcampus.ac.za
Scatter plot with varying symbol sizes

8
www.belgiumcampus.ac.za
Bar plots of means with confidence intervals
• A very common figure in publications is to show group means with
confidence intervals, an ideal companion to the output of an ANOVA
analysis. do, this with the bargraph.CI function fom sciplot package.

9
www.belgiumcampus.ac.za
Bar plots of means with confidence intervals

10
www.belgiumcampus.ac.za

You might also like