From b1ef7ecfbfb17ebae424a62fa773ca0b677a097e Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 11 May 2019 17:27:02 -0400 Subject: [PATCH] Add plots to R guide (#25444) * Add plots to R guide * Deleted plotting file * added a plotting index.md for R --- guide/english/r/plotting/index.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 guide/english/r/plotting/index.md diff --git a/guide/english/r/plotting/index.md b/guide/english/r/plotting/index.md new file mode 100644 index 0000000000..a9796e52fc --- /dev/null +++ b/guide/english/r/plotting/index.md @@ -0,0 +1,16 @@ +--- +title: Plotting in R +--- +## Plotting + The base version of R allows us to make many types of plots! + The syntax for a simple scatterplot goes something like this: + ```r +plot(x, y) +``` +We create a graph using the plot() function and supply the two parameters, x and y, which are the two columns you want to plot in your dataset. + So in the mpg dataset that is available in the tidyverse library, if we wanted to make a scatterplot of the two variables 'cyl' and 'hwy': + ```r +library(tidyverse) +attach(mpg) +plot(cyl, hwy) +```