Draw ggplot2 Plot with Factor on X-Axis in R (Example) | geom_line() Function of the ggplot2 Package
Автор: Statistics Globe
Загружено: 2022-08-10
Просмотров: 880
How to create a ggplot2 graphic with a factor on the x-axis in the R programming language. More details: https://statisticsglobe.com/draw-ggpl...
R code of this video:
data <- data.frame(group = factor(letters[1:5]), # Create example data
value = c(1, 4, 2, 5, 3))
data # Print example data
install.packages("ggplot2") # Install & load ggplot2
library("ggplot2")
ggplot(data, # Line plot with factor on x-axis
aes(x = group,
y = value,
group = 1)) +
geom_line()
Follow me on Social Media:
Facebook – Statistics Globe Page: / statisticsglobecom
Facebook – R Programming Group for Discussions & Questions: / statisticsglobe
Facebook – Python Programming Group for Discussions & Questions: / statisticsglobepython
LinkedIn – Statistics Globe Page: / statisticsglobe
LinkedIn – R Programming Group for Discussions & Questions: / 12555223
LinkedIn – Python Programming Group for Discussions & Questions: / 12673534
Twitter: / joachimschork
Music by bensound.com
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: