Популярное

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

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

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

Топ запросов

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

Color Scatterplot Points in R (2 Examples) | Draw XY-Plot with Colors | Base R & ggplot2 Package

Автор: Statistics Globe

Загружено: 2021-05-05

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

Описание:

How to color scatterplot points in the R programming language. More details: https://statisticsglobe.com/color-sca...
R code of this video:

set.seed(9832674) # Set random seed
x <- rnorm(300) # Create x variable
y <- rnorm(300) + x # Create correlated y variable
group <- rep(1, 300) # Create group variable
group[x > 0] <- 2
group[x >1.5] <- 3
data <- data.frame(x, y, group) # Create data frame

plot(data$x, # Draw Base R plot
data$y,
pch = 16,
col = data$group)

install.packages("ggplot2") # Install ggplot2 package
library("ggplot2") # Load ggplot2 package

ggplot(data, # Draw ggplot2 plot
aes(x = x,
y = y,
col = as.factor(group))) +
geom_point()

Follow me on Social Media:
Facebook:   / statisticsglobecom  
LinkedIn:   / statisticsglobe  
Patreon:   / statisticsglobe  
Pinterest: https://www.pinterest.de/JoachimSchork
Reddit:   / joachimschork  
Twitter:   / joachimschork  

Color Scatterplot Points in R (2 Examples) | Draw XY-Plot with Colors | Base R & ggplot2 Package

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

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

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

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

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

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

array(10) { [0]=> object(stdClass)#5039 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "uO9Tpi9Sd78" ["related_video_title"]=> string(108) "Draw ggplot2 Plot with Lines & Points in R (Example) | Add Scatterplot Line | geom_line & geom_point" ["posted_time"]=> string(21) "4 года назад" ["channelName"]=> string(16) "Statistics Globe" } [1]=> object(stdClass)#5012 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "5AQ_-JHnmA0" ["related_video_title"]=> string(78) "Ggplot Colors - how to use colors effectively when creating plots with ggplot2" ["posted_time"]=> string(21) "2 года назад" ["channelName"]=> string(17) "R Programming 101" } [2]=> object(stdClass)#5037 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "gjOj4IAWSEw" ["related_video_title"]=> string(53) "Preventing AI Brain Rot by Solving a Leetcode Problem" ["posted_time"]=> string(24) "11 часов назад" ["channelName"]=> string(12) "Web Dev Cody" } [3]=> object(stdClass)#5044 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "mbvU8fF4eGM" ["related_video_title"]=> string(97) "Using the the ggplot2 R package to create a boxplot with individual data points overlayed (CC091)" ["posted_time"]=> string(21) "4 года назад" ["channelName"]=> string(18) "Riffomonas Project" } [4]=> object(stdClass)#5023 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "mNpBrHwOCt4" ["related_video_title"]=> string(102) "Principal Component Analysis in R Programming | How to Apply PCA | Step-by-Step Tutorial & Example" ["posted_time"]=> string(19) "1 год назад" ["channelName"]=> string(16) "Statistics Globe" } [5]=> object(stdClass)#5041 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "Uo5D8en-4PI" ["related_video_title"]=> string(100) "How to Create a Tree Height Map in R | Example Ft @milos-makes-maps | Visualize Global Forest Canopy" ["posted_time"]=> string(19) "1 год назад" ["channelName"]=> string(16) "Statistics Globe" } [6]=> object(stdClass)#5036 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "EItlUEPCIzM" ["related_video_title"]=> string(68) "Machine Learning Tutorial Python - 13: K Means Clustering Algorithm" ["posted_time"]=> string(19) "6 лет назад" ["channelName"]=> string(10) "codebasics" } [7]=> object(stdClass)#5046 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "blWdjRUPP6E" ["related_video_title"]=> string(72) "Разведчик о том, как использовать людей" ["posted_time"]=> string(25) "2 недели назад" ["channelName"]=> string(18) "Коллектив" } [8]=> object(stdClass)#5022 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "jJmiD6iSH0I" ["related_video_title"]=> string(44) "R Tutorial - Basic Scatter plot using ggplot" ["posted_time"]=> string(21) "3 года назад" ["channelName"]=> string(9) "JP Gannon" } [9]=> object(stdClass)#5040 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "C-TsuHseZkg" ["related_video_title"]=> string(168) "ПРЕМЬЕРА СВЕЖЕГО ДЕТЕКТИВА 2025 ИЗ ФРАНЦУЗСКОЙ КОЛЛЕКЦИИ "УБИЙСТВА В..."!Убийство в Гильвинеке" ["posted_time"]=> string(21) "7 дней назад" ["channelName"]=> string(10) "Filmegator" } }
Draw ggplot2 Plot with Lines & Points in R (Example) | Add Scatterplot Line | geom_line & geom_point

Draw ggplot2 Plot with Lines & Points in R (Example) | Add Scatterplot Line | geom_line & geom_point

Ggplot Colors - how to use colors effectively when creating plots with ggplot2

Ggplot Colors - how to use colors effectively when creating plots with ggplot2

Preventing AI Brain Rot by Solving a Leetcode Problem

Preventing AI Brain Rot by Solving a Leetcode Problem

Using the the ggplot2 R package to create a boxplot with individual data points overlayed (CC091)

Using the the ggplot2 R package to create a boxplot with individual data points overlayed (CC091)

Principal Component Analysis in R Programming | How to Apply PCA | Step-by-Step Tutorial & Example

Principal Component Analysis in R Programming | How to Apply PCA | Step-by-Step Tutorial & Example

How to Create a Tree Height Map in R | Example Ft @milos-makes-maps | Visualize Global Forest Canopy

How to Create a Tree Height Map in R | Example Ft @milos-makes-maps | Visualize Global Forest Canopy

Machine Learning Tutorial Python - 13:  K Means Clustering Algorithm

Machine Learning Tutorial Python - 13: K Means Clustering Algorithm

Разведчик о том, как использовать людей

Разведчик о том, как использовать людей

R Tutorial - Basic Scatter plot using ggplot

R Tutorial - Basic Scatter plot using ggplot

ПРЕМЬЕРА СВЕЖЕГО ДЕТЕКТИВА 2025 ИЗ ФРАНЦУЗСКОЙ КОЛЛЕКЦИИ

ПРЕМЬЕРА СВЕЖЕГО ДЕТЕКТИВА 2025 ИЗ ФРАНЦУЗСКОЙ КОЛЛЕКЦИИ "УБИЙСТВА В..."!Убийство в Гильвинеке

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



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



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