How to create line chart with points using ggplot2 & plotly - includes data pivot - R Project

Поделиться
HTML-код
  • Опубликовано: 15 июл 2024
  • A step by step follow along practical example - In an R script upload a spreadsheet, manipulate the data by pivoting columns, and then producing a line chart with data points (dots) using ggplot2 and plotly.
    Timings:
    00:00 Introduction
    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 - ggplot2.tidyverse.org/referen... and plotly.com/r/
    The excel spreadsheet used in this project can be found at dataforknowledge.co.uk/r-proj...
    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 www.gov.scot/publications/tea...
    #rprogramming #ggplot2 #linechart #data #rproject #płoty #rscript #ggplot2linechart
    #ggplot2linechartwithdots #dataanalysis #datavisualization
  • ХоббиХобби

Комментарии • 15

  • @naveediqbal8683
    @naveediqbal8683 6 месяцев назад +1

    greatly explained, Hats off!

    • @DFK_data
      @DFK_data  6 месяцев назад

      Thank you! Glad the video was helpful.

  • @KhushiGupta-tr2vp
    @KhushiGupta-tr2vp 5 месяцев назад +1

    No RUclips video that explains this as clear;y as you did. Thank you very much!

    • @DFK_data
      @DFK_data  5 месяцев назад

      You're welcome! Thank you!

  • @jenniferenekebe8475
    @jenniferenekebe8475 7 месяцев назад +1

    I spent 12 hours trying to get this. I watched several RUclips videos and no one explained it as clearly as you did. This is wonderful. Thank you!

    • @DFK_data
      @DFK_data  7 месяцев назад

      Thank you! Glad you found the video helpful.

  • @inamhameed4963
    @inamhameed4963 Год назад +1

    Greatly explained! Hats off

    • @DFK_data
      @DFK_data  11 месяцев назад

      Thank you!

  • @AndresVeraF
    @AndresVeraF Год назад +1

    Thanks for this tutorial

    • @DFK_data
      @DFK_data  Год назад

      Thank you! Glad you enjoyed the video.

  • @ahmed007Jaber
    @ahmed007Jaber Год назад +1

    Thank you for this. Love the tutorials
    would be interesting to see 100% fully polished publication ready charts and learn about the customisation that can be done

    • @DFK_data
      @DFK_data  Год назад

      Thank you! Glad you enjoy the videos

    • @ahmed007Jaber
      @ahmed007Jaber Год назад

      @@DFK_data Pleasure. Truth be told, good ideas and engaging tutorials.
      I have been searching content for branded word rmarkdown files. got experience in them? really fun and useful

  • @MrCraptakular
    @MrCraptakular Год назад +1

    I have just started to learn R over the last week or two and am progressing through udemy courses. I found your channel a few days ago and you are one of few that clearly defines the steps in each video. The Leaflet videos you did were good too. I am trying to work out today how to plot a Leaflet map using a data frame with a WKT Geometry column that contains Lines, points and polygons. I think I just need to do multiple filtered data frames to pass each type of WKT to the correct plotting function in Leaflet. Wish me luck!

    • @DFK_data
      @DFK_data  Год назад

      Good luck! Thank you for your kind comments. Glad you are finding the videos helpful.