Author

All this exercise has been done by Zahanat_PDE

library(ggplot2)
ggplot(mpg, aes(x = displ, y = hwy)) + geom_point() +  facet_grid(. ~ cty)

R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

library(ggplot2)
ggplot(data = mpg) + geom_point(mapping = aes(x = displ, y = hwy)) + facet_grid(drv ~ .)

Including Plots

You can also embed plots, for example:

library(ggplot2)
ggplot(data = mpg, mapping = aes(x = displ, y = hwy)) +   geom_point() + geom_smooth()
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

library(ggplot2)
ggplot() + geom_point(data = mpg, mapping = aes(x = displ, y = hwy)) + geom_smooth(data = mpg, mapping = aes(x = displ, y = hwy))
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

library(ggplot2)
ggplot(mpg, aes(x = class, y = drv)) +geom_point()

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.