Book Image

Learning Shiny

By : Hernan Resnizky
Book Image

Learning Shiny

By: Hernan Resnizky

Overview of this book

Table of Contents (19 chapters)
Learning Shiny
Credits
About the Author
Acknowledgements
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Introducing R, RStudio, and Shiny
Index

Plotting options


So far in the examples presented, the display of the plots has been just the default one. Of course, there are multiple possibilities of customizing this. For the purpose of extension, only the following listed ones will be covered:

  • col: This is a string vector that defines the color. It can be written either as the color name (red, blue, and so on) or by its hexadecimal code. If the col argument has a vector shorter than the number of elements to plot, it will be recycled as explained in Chapter 2, First Steps towards Programming in R.

  • pch: This argument defines the shape of the points plotted. The different options are numerically coded. For a complete reference, visit http://www.endmemo.com/program/R/pchsymbols.php.

Consequently, pch receives a numeric vector in which each number corresponds to one symbol according to the preceding image. This is similar to col, where the vector is recycled if needed:

  • main: This is the title of the plot.

  • xlab: This is the label of the...