Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

R Tutorial: Making Better Plots

Автор: DataCamp

Загружено: 2020-03-04

Просмотров: 324

Описание:

Want to learn more? Take the full course at https://learn.datacamp.com/courses/ca... at your own pace. More than a video, you'll learn hands-on coding & quickly apply skills to your daily work.

---

One of the places forcats really shines is in helping you make better graphs. Have you ever made a graph and everything is in the wrong order?

What's wrong with this plot? Well, how quickly could you answer "what's the third biggest problem people face?" It's very hard to read this graph right away. For example, to find the problem the largest percentage of people consider an issue, we have to find the point all the way on the right and then connect it back to the text on the y-axis. It's even more difficult to do this for points in the middle.

To fix this, we can use a forcats function, fct_reorder(). Many forcats functions start with fct, which stands for factor. From now on, I'll be saying factor instead of fct.

Factor reorder takes two arguments: the variable you want to reorder and the variable you want to reorder it by. By adding this to our ggplot2 function, we'll have a nicely ordered scatter plot and we can read the y-axis top to bottom.
In that case, we're looking at your unordered variable in relation to another variable. But sometimes we are looking at the variable by itself, such as in a bar chart. Then, you usually want to order by its frequency. Let’s take a look at how we can do this for a frequency bar chart for CurrentJobTitleSelect.

Just like in the previous graph, this one is hard to read. It's fairly easy to see Data Scientist is the most popular job title, and operations research practitioner and data miner the least, but what about the fourth most popular title?
To make the graph easier to read, we can use the forcats function fct_infreq(). This orders a factor by the frequency of each level.

Now the graph is much more easy to read; we can easily see that the fourth most popular title is a data analyst. To make it even better, we could switch the order, from most to least frequent.

To do this, we can use the function fct_rev(). This takes the current levels of the factor and reverses them.

Time to put this into practice.

#DataCamp #RTutorial #CategoricalDataintheTidyverse #MakingBetterPlots

R Tutorial: Making Better Plots

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

array(10) { [0]=> object(stdClass)#5172 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "bfqiGAn6Ws0" ["related_video_title"]=> string(83) "Big Data with PySpark Crash Course | Machine Learning, Feature Engineering and More" ["posted_time"]=> string(25) "3 недели назад" ["channelName"]=> string(8) "DataCamp" } [1]=> object(stdClass)#5145 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "LgXzzu68j7M" ["related_video_title"]=> string(44) "Учебник по Excel за 15 минут" ["posted_time"]=> string(19) "1 год назад" ["channelName"]=> string(15) "Kevin Stratvert" } [2]=> object(stdClass)#5170 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "jfKfPfyJRdk" ["related_video_title"]=> string(47) "lofi hip hop radio 📚 beats to relax/study to" ["posted_time"]=> string(0) "" ["channelName"]=> string(9) "Lofi Girl" } [3]=> object(stdClass)#5177 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "JlGK0KpG4ps" ["related_video_title"]=> string(39) "Building & Evaluating RAG Pipelines" ["posted_time"]=> string(65) "Трансляция закончилась 5 дней назад" ["channelName"]=> string(8) "DataCamp" } [4]=> object(stdClass)#5156 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "NNSHu0rkew8" ["related_video_title"]=> string(47) "Учебник по Power BI за 10 минут" ["posted_time"]=> string(21) "2 года назад" ["channelName"]=> string(15) "Kevin Stratvert" } [5]=> object(stdClass)#5174 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "iVa1Rj7cOqk" ["related_video_title"]=> string(92) "Как срочников заманивают на войну (English subtitles) @Max_Katz" ["posted_time"]=> string(24) "13 часов назад" ["channelName"]=> string(19) "Максим Кац" } [6]=> object(stdClass)#5169 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "4MvhP2zKozI" ["related_video_title"]=> string(120) "Основные теоремы в теории игр — Алексей Савватеев на ПостНауке" ["posted_time"]=> string(19) "5 лет назад" ["channelName"]=> string(18) "ПостНаука" } [7]=> object(stdClass)#5179 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "22tkx79icy4" ["related_video_title"]=> string(55) "RAG | САМОЕ ПОНЯТНОЕ ОБЪЯСНЕНИЕ!" ["posted_time"]=> string(23) "1 месяц назад" ["channelName"]=> string(8) "AI RANEZ" } [8]=> object(stdClass)#5155 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "y0-l54dm-uc" ["related_video_title"]=> string(109) "Функция ВПР в Excel ➤ Как пользоваться функцией ВПР (VLOOKUP) в Excel" ["posted_time"]=> string(21) "4 года назад" ["channelName"]=> string(23) "Андрей Сухов" } [9]=> object(stdClass)#5173 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "_hVyRWEdYx4" ["related_video_title"]=> string(168) "ЧЕМЕЗОВ НОЕТ/ АД В СЕЛЬХОЗКЕ/ НАДВИГАЮЩИЙСЯ БАНКОВСКИЙ КРИЗИС. Милов о российской экономике" ["posted_time"]=> string(24) "12 часов назад" ["channelName"]=> string(19) "Майкл Наки" } }
Big Data with PySpark Crash Course | Machine Learning, Feature Engineering and More

Big Data with PySpark Crash Course | Machine Learning, Feature Engineering and More

Учебник по Excel за 15 минут

Учебник по Excel за 15 минут

lofi hip hop radio 📚 beats to relax/study to

lofi hip hop radio 📚 beats to relax/study to

Building & Evaluating RAG Pipelines

Building & Evaluating RAG Pipelines

Учебник по Power BI за 10 минут

Учебник по Power BI за 10 минут

Как срочников заманивают на войну (English subtitles) @Max_Katz

Как срочников заманивают на войну (English subtitles) @Max_Katz

Основные теоремы в теории игр — Алексей Савватеев на ПостНауке

Основные теоремы в теории игр — Алексей Савватеев на ПостНауке

RAG | САМОЕ ПОНЯТНОЕ ОБЪЯСНЕНИЕ!

RAG | САМОЕ ПОНЯТНОЕ ОБЪЯСНЕНИЕ!

Функция ВПР в Excel ➤ Как пользоваться функцией ВПР (VLOOKUP) в Excel

Функция ВПР в Excel ➤ Как пользоваться функцией ВПР (VLOOKUP) в Excel

ЧЕМЕЗОВ НОЕТ/ АД В СЕЛЬХОЗКЕ/ НАДВИГАЮЩИЙСЯ БАНКОВСКИЙ КРИЗИС. Милов о российской экономике

ЧЕМЕЗОВ НОЕТ/ АД В СЕЛЬХОЗКЕ/ НАДВИГАЮЩИЙСЯ БАНКОВСКИЙ КРИЗИС. Милов о российской экономике

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]