How to create a ggplot2 graph showing data from different sources in the R programming language. More details: [ Ссылка ]
R code of this video:
data1 <- data.frame(x = 1:5, # Create first data frame
y = 1:5)
data2 <- data.frame(x = 2:6, # Create second data frame
y = 8:4)
install.packages("ggplot2") # Install ggplot2 package
library("ggplot2") # Load ggplot2 package
ggp <- ggplot(NULL, aes(x, y)) + # Draw ggplot2 plot
geom_point(data = data1, col = "red") +
geom_line(data = data2, col = "blue")
ggp # Draw plot
Follow me on Social Media:
Twitter: [ Ссылка ]
Facebook: [ Ссылка ]
Reddit: [ Ссылка ]
Pinterest: [ Ссылка ]
Ещё видео!