Book Image

R Graphs Cookbook Second Edition

Book Image

R Graphs Cookbook Second Edition

Overview of this book

Table of Contents (22 chapters)
R Graphs Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 5. Creating Line Graphs and Time Series Charts

In this chapter, we will cover the following recipes:

  • Adding customized legends for multiple-line graphs

  • Using margin labels instead of legends for multiple-line graphs

  • Adding horizontal and vertical grid lines

  • Adding marker lines at specific X and Y values using abline

  • Creating sparklines

  • Plotting functions of a variable in a dataset

  • Formatting time series data for plotting

  • Plotting the date or time variable on the X axis

  • Annotating axis labels in different human-readable time formats

  • Adding vertical markers to indicate specific time events

  • Plotting data with varying time averaging periods

  • Creating stock charts