R Tutorial: The grammar of graphics
Автор: DataCamp
Загружено: 10 мар. 2020 г.
Просмотров: 1 037 просмотров
Want to learn more? Take the full course at https://learn.datacamp.com/courses/in... at your own pace. More than a video, you'll learn hands-on coding & quickly apply skills to your daily work.
---
The first step in thinking creatively about data visualization is to appreciate that graphics are built upon an underlying grammar.
To begin, let's consider one of the most well-known sentences in English.
The quick brown fox jumps over the lazy dog.
Every word in the sentence has a clear grammatical definition and when we write text, we take great care to choose the grammatical elements so that we communicate a very specific message.
If we changed any of the grammatical elements of this sentence it would change the meaning, sometimes subtly, sometimes dramatically.
The same concept holds true for data visualization - graphics are built on an underlying grammar.
The grammar of graphics is a plotting framework developed by Leland Wilkinson and published in his 1999 book, The Grammar of Graphics.
There are two key things to note about the grammar of graphics.
First, graphics are made up of distinct layers of grammatical elements, and second, meaningful plots are built around appropriate aesthetic mappings.
To continue our analogy to written grammar, the layers are like the adjectives and nouns and the aesthetic mappings are like the grammatical rules for how to assemble that vocabulary.
Let's explore grammatical elements first. There are three essential grammatical elements: data, aesthetics, and geometries.
The data is obviously the data that we want to plot. the aesthetics layer refers to the scales onto which we will map our data, and the geom layer refers to the actual shape the data will take in the plot.
The rest are optional layers. This includes the theme layer, which controls all the non-data ink.
In this course, we'll cover these first four layers which will comprise your core competency.
In the next course, we'll explore the remaining grammatical elements: the statistics, coordinates, and facets layers.
This diagram gives an example of some of the terms we'll encounter in each element.
Whenever we make a plot we are choosing among these options and many others not displayed.
By the end of this course, you'll be able to generate meaningful and publication-quality exploratory plots using the first four layers.
Once we've covered the remaining three layers in the second course, we'll be using data viz as a tool for exploratory data analysis.
The third course will take your skills to the next level as we explore advanced plot types and special data sources.
And finally, for those ready to go really into detail, the fourth course will help you merge data viz and efficient programming in R.
Let's head over to the exercises and explore one of the datasets that you'll be using throughout the two courses.
#DataCamp #RTutorial #DataVisualizationwithggplot2

Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: