Популярное

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

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

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

Топ запросов

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

How to create a nice scatter plot in R using ggplot2? | StatswithR | Arnab Hazra

Автор: StatswithR

Загружено: 2020-08-24

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

Описание:

Here we explain how to generate a presentation/publication-quality scatter plot plot in R/R-studio using ggplot2. The codes for the steps explained in the video are as follows. Copy and paste them into R, run them one-by-one and try to understand what each argument is doing.

#datascience #datavisualization #visualization #ggplot2 #tidyverse #scatterplot #rstudio #rcoding #normal

rm(list = ls())

library(readr)
library(ggplot2)

mydir = "/home/hazraa/Desktop/youtube/scatterplot"

setwd(mydir)

gretoeflfile = "datasets_14872_228180_Admission_Predict.csv"

gretoefldata = read_csv(gretoeflfile)

gre = gretoefldata$`GRE Score`
toefl = gretoefldata$`TOEFL Score`

p = ggplot() + geom_point(aes(x = toefl, y = gre), size = 2)
ggsave(p, filename = "scatter_ggplot1.pdf", width = 6, height = 6)

p = ggplot() + geom_point(aes(x = toefl, y = gre), size = 2) +
xlab("TOEFL Score") + ylab("GRE Score")
ggsave(p, filename = "scatter_ggplot2.pdf", width = 6, height = 6)

p = ggplot() + geom_point(aes(x = toefl, y = gre), size = 2) +
xlab("TOEFL Score") + ylab("GRE Score") +
ggtitle("TOEFL versus GRE")
ggsave(p, filename = "scatter_ggplot3.pdf", width = 6, height = 6)

p = ggplot() + geom_point(aes(x = toefl, y = gre), size = 2) +
xlab("TOEFL Score") + ylab("GRE Score") +
ggtitle("TOEFL versus GRE") +
theme(plot.title = element_text(hjust = 0.5))
ggsave(p, filename = "scatter_ggplot4.pdf", width = 6, height = 6)

p = ggplot() + geom_point(aes(x = toefl, y = gre), size = 2) +
xlab("TOEFL Score") + ylab("GRE Score") +
ggtitle("TOEFL versus GRE") +
theme(plot.title = element_text(hjust = 0.5)) +
theme(axis.text=element_text(size=15),
axis.title=element_text(size=15),
plot.title = element_text(size=15))
ggsave(p, filename = "scatter_ggplot5.pdf", width = 6, height = 6)

final.data = data.frame(gre = gre, toefl = toefl)

p = ggplot(data = final.data, aes(x = toefl, y = gre)) + geom_point() +
xlab("TOEFL Score") + ylab("GRE Score") +
ggtitle("TOEFL versus GRE") +
theme(plot.title = element_text(hjust = 0.5)) +
theme(axis.text=element_text(size=15),
axis.title=element_text(size=15),
plot.title = element_text(size=15)) +
geom_smooth()
ggsave(p, filename = "scatter_ggplot6.pdf", width = 6, height = 6)

p = ggplot(final.data, aes(x = toefl, y = gre)) + geom_point(size = 2) +
xlab("TOEFL Score") + ylab("GRE Score") +
ggtitle("TOEFL versus GRE") +
theme(plot.title = element_text(hjust = 0.5)) +
theme(axis.text=element_text(size=15),
axis.title=element_text(size=15),
plot.title = element_text(size=15)) +
geom_smooth(method=lm)
ggsave(p, filename = "scatter_ggplot7.pdf", width = 6, height = 6)

p = ggplot(final.data, aes(x = toefl, y = gre)) + geom_point(size = 2) +
xlab("TOEFL Score") + ylab("GRE Score") +
ggtitle("TOEFL versus GRE") +
theme(plot.title = element_text(hjust = 0.5)) +
theme(axis.text=element_text(size=15),
axis.title=element_text(size=15),
plot.title = element_text(size=15)) +
geom_smooth(method=lm, se=FALSE)
ggsave(p, filename = "scatter_ggplot8.pdf", width = 6, height = 6)

p = ggplot(final.data, aes(x = toefl, y = gre)) + geom_point(size = 2) +
xlab("TOEFL Score") + ylab("GRE Score") +
ggtitle("TOEFL versus GRE") +
theme(plot.title = element_text(hjust = 0.5)) +
theme(axis.text=element_text(size=15),
axis.title=element_text(size=15),
plot.title = element_text(size=15)) +
geom_smooth(method = "lm", formula = y ~ poly(x, 3))
ggsave(p, filename = "scatter_ggplot9.pdf", width = 6, height = 6)

library(mgcv)

p = ggplot(final.data, aes(x = toefl, y = gre)) + geom_point(size = 2) +
xlab("TOEFL Score") + ylab("GRE Score") +
ggtitle("TOEFL versus GRE") +
theme(plot.title = element_text(hjust = 0.5)) +
theme(axis.text=element_text(size=15),
axis.title=element_text(size=15),
plot.title = element_text(size=15)) +
geom_smooth(method = gam, formula = y ~ s(x))
ggsave(p, filename = "scatter_ggplot10.pdf", width = 6, height = 6)


Music used
Quiet Place by Jonny Easton
Link:    • Quiet Place - Soft Piano Music - Royalty Free  
Check out his channel
Link:    / jonnyeaston  

How to create a nice scatter plot in R using ggplot2? | StatswithR | Arnab Hazra

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

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

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

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

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

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

Выучите R за 39 минут

Выучите R за 39 минут

Deep House Mix 2025 | Vocal Deep Feelings Mix 2025| Nu Disco, Chill House | Study/Work/Relax Session

Deep House Mix 2025 | Vocal Deep Feelings Mix 2025| Nu Disco, Chill House | Study/Work/Relax Session

🎙️ Честное слово с Игорем Липсицем

🎙️ Честное слово с Игорем Липсицем

Музыка лечит сердце и сосуды🌸 Успокаивающая музыка восстанавливает нервную систему,расслабляющая

Музыка лечит сердце и сосуды🌸 Успокаивающая музыка восстанавливает нервную систему,расслабляющая

Если у тебя спросили «Как твои дела?» — НЕ ГОВОРИ! Ты теряешь свою силу | Еврейская мудрость

Если у тебя спросили «Как твои дела?» — НЕ ГОВОРИ! Ты теряешь свою силу | Еврейская мудрость

4 Hours Chopin for Studying, Concentration & Relaxation

4 Hours Chopin for Studying, Concentration & Relaxation

How to draw nested categorical boxplots in R using ggplot2? | Salaries | StatswithR | Arnab Hazra

How to draw nested categorical boxplots in R using ggplot2? | Salaries | StatswithR | Arnab Hazra

SHAZAM Top 50🏖️Лучшая Музыка 2025🏖️Зарубежные песни Хиты🏖️Популярные Песни Слушать Бесплатно #40

SHAZAM Top 50🏖️Лучшая Музыка 2025🏖️Зарубежные песни Хиты🏖️Популярные Песни Слушать Бесплатно #40

R&B Relax Playlist 2025 🎶  RnB Soul | Cozy Hearts , Smooth Vibes for Relaxation, Focus and Chill

R&B Relax Playlist 2025 🎶 RnB Soul | Cozy Hearts , Smooth Vibes for Relaxation, Focus and Chill

Музыка для работы за компьютером | Фоновая музыка для концентрации и продуктивности

Музыка для работы за компьютером | Фоновая музыка для концентрации и продуктивности

[2026] Feeling Good Mix - English Deep House, Vocal House, Nu Disco | Emotional / Intimate Mood

[2026] Feeling Good Mix - English Deep House, Vocal House, Nu Disco | Emotional / Intimate Mood

How to draw a nice pie chart in R using ggplot2? | Smartphone brands 2020 | StatswithR | Arnab Hazra

How to draw a nice pie chart in R using ggplot2? | Smartphone brands 2020 | StatswithR | Arnab Hazra

How to create a nice bar chart in R using ggplot2? | Top 10 economies | StatswithR | Arnab Hazra

How to create a nice bar chart in R using ggplot2? | Top 10 economies | StatswithR | Arnab Hazra

How to make a scatter plot in R with Regression Line (ggplot2)

How to make a scatter plot in R with Regression Line (ggplot2)

Физически-информированные нейронные сети (PINN) [Машинное обучение с учетом физики]

Физически-информированные нейронные сети (PINN) [Машинное обучение с учетом физики]

Белковский про болезнь Кадырова, будущее Гренландии и провал геополитики Путина🎙️ Честное слово

Белковский про болезнь Кадырова, будущее Гренландии и провал геополитики Путина🎙️ Честное слово

Playlist,,Deep House,Music Played in Louis Vuitton Stores

Playlist,,Deep House,Music Played in Louis Vuitton Stores

How to Make Scatter plot in R? | R Data Visualization | R Programming Tutorial #34

How to Make Scatter plot in R? | R Data Visualization | R Programming Tutorial #34

How to draw a bubble plot in R using ggplot2? | Graduate Admissions | StatswithR | Arnab Hazra

How to draw a bubble plot in R using ggplot2? | Graduate Admissions | StatswithR | Arnab Hazra

How to use ggplot to create beautiful scatter plots. This is an R programming for beginners video.

How to use ggplot to create beautiful scatter plots. This is an R programming for beginners video.

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



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



Контакты для правообладателей: infodtube@gmail.com