MENU

Fun & Interesting

How to Create Line Charts with Points Using ggplot2 & plotly in R | Data Visualization Tutorial

Data For Knowledge 9,743 2 years ago
Video Not Working? Fix It Now

Meet my R programming tutorial and learn how to create a dynamic line chart with points using ggplot2 and Plotly! In this step-by-step guide, I'll show you how to manipulate your data, pivot it, and build an interactive visualization. We'll take a real-world dataset of STEM teachers in Scotland and walk through the process of cleaning and reshaping the data, plotting trends, and adding interactivity. You'll know how to create visually appealing and functional charts that you can customize to your needs! Timings: 00:00 How to create a line chart in R 00:55 Set up R script and load data 02:20 Pivot using pivot_longer (tidyr package) 05:25 Set up chart (ggplot2 package) 07:45 Add trend line 09:05 Add points 09:55 Add labels to chart 11:55 Themes (theme()) changes to bar chart 15:00 Comma separate values on the Y axis 16:20 Add popup on hover over of dot (plotly) package There is a lot more alterations which can be done to the chart using ggplot2 and plotly. A reference which you may find helpful - https://ggplot2.tidyverse.org/reference/index.html and https://plotly.com/r/ The excel spreadsheet used in this project can be found at https://dataforknowledge.co.uk/r-project-create-line-chart/ Note: 3rd party data was used in this project therefore I take no responsibility for the quality or accuracy or interpretation of the data. The data can be found at https://www.gov.scot/publications/teacher-census-supplementary-statistics/ ⭕ If you like this Channel: ✅ Like ✅ Share ✅ Comment ✅ SUBSCRIBE for more videos Also click on the notification 🔔 icon. Thanks for watching...❕ https://www.youtube.com/@DFK_data ➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖ Your Go-To Playlist To Learn R: https://www.youtube.com/playlist?list=PL856L03J0TRzutyNPb5yD2glKnrcWKpFm 🎬SUGGESTED VIDEOS TO LEARN R: Don't forget to watch 📽 My other videos. Please check them out: ✅ https://youtu.be/2mkVvWFs4k8?si=Zk9jmmZejYNEKI5f ✅ https://youtu.be/DhJDI6h1vRE?si=7WtqPSjf7JAlbJe9 ✅ https://youtu.be/gkE5hToDFJg?si=P1nG8FRhLBN-7by_ ➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖ ** FOLLOW ME ** LinkedIn: www.linkedin.com/in/pauline-cairns-data ⭕ Hashtags: #rprogramming #ggplot2 #linechart #data #rproject #płoty #rscript #dataanalysis #datavisualizationtools #programming #rprogrammingforbeginners #datavisualization #rstudio #datascience

Comment