Тёмный

R Project - how to create bar chart (ggplot2) from spreadsheet-includes data pivot & remove a column 

Data For Knowledge
Подписаться 11 тыс.
Просмотров 15 тыс.
50% 1

In an R script upload a spreadsheet, manipulate the data by removing column/variable, change variable name, and pivot columns, and then producing a bar chart.
Timings:
00:00 Introduction
00:40 Set up R script and load data
02:10 Remove a column/variable from the database
03:20 Change column/variable header name
04:35 Set order of category (change from default alphabetical)
07:20 Pivot using pivot_longer (tidyr package)
10:10 Set up bar chart (ggplot2 package)
13:00 Add labels to bar chart
15:10 Themes (theme()) changes to bar chart
19:00 Change colour of bars/columns.
The video mentioned at 3.10 relating to altering the number of observations/variables (rows/columns) can be found at • In R dataframe - how t...
There is a lot more alterations which can be done to the bar chart using ggplot2. A reference which you may find helpful - ggplot2.tidyverse.org/referen.... This also explains why geom_col is used in this video, rather than geom_bar - ie it is because want height of bars to represent the values in the data.
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 of the data. The data can be found at www.gov.scot/publications/tea...
#rprogramming #barchart #ggplot2 #rproject #data #ggplot2barchart

Хобби

Опубликовано:

 

3 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 27   
@lucacotan4492
@lucacotan4492 9 месяцев назад
Thank you so much for the video! You actually showed perfectly how to transform the excel sheet into a barplot in "R"!
@DFK_data
@DFK_data 9 месяцев назад
You're very welcome!
@APerson-ky2gh
@APerson-ky2gh Месяц назад
Thanks so much, I'm a second year biology student who just started learning r for ecology data stuff and this video was so helpful
@DFK_data
@DFK_data Месяц назад
Thank you! Glad the video helped. Good luck with your studies!
@leanne-se2sp
@leanne-se2sp Месяц назад
Hi, I'm in my 2nd year at university and have never been able to grasp R in any of the workshops but your video made it so easy! Thank you so much, I have been panicking about this assignment for weeks, and with your video, I can finally get it done, thank you again :) 10/10!
@DFK_data
@DFK_data Месяц назад
Thank you! Glad the video helped. Good luck with your studies!
@inamhameed4963
@inamhameed4963 11 месяцев назад
Great, well-structured and organized. Much recommended your channel!!!
@DFK_data
@DFK_data 11 месяцев назад
Thanks! Much appreciated
@DingDongGrahamBell
@DingDongGrahamBell 6 месяцев назад
Thank YOU so much! Quite informative! Have a Blessed New Year!
@DFK_data
@DFK_data 6 месяцев назад
Thank you! Glad you found the video helpful
@diana.anuphama7901
@diana.anuphama7901 Год назад
Thank you so much. Extremely helpful and well presented.
@DFK_data
@DFK_data Год назад
Thank you! Glad you enjoyed the video
@diana.anuphama7901
@diana.anuphama7901 Год назад
@@DFK_data of course. Please keep up the good work
@lindalangford320
@lindalangford320 4 месяца назад
Thanks for such an informative video. It is greatly appreciated.
@DFK_data
@DFK_data 4 месяца назад
Thank you!
@cristianjesus255
@cristianjesus255 4 месяца назад
OMG, this video helped me so much!!
@DFK_data
@DFK_data 4 месяца назад
Thanks! Glad you found the video helpful.
@pedropuente3761
@pedropuente3761 8 месяцев назад
Love this!
@DFK_data
@DFK_data 8 месяцев назад
Thanks! Glad you enjoyed the video.
@papito-qf2jj
@papito-qf2jj 10 месяцев назад
thanks alot , it is so helpful
@DFK_data
@DFK_data 10 месяцев назад
Thanks for watching the video! Glad it was helpful.
@ibrahimlawan9663
@ibrahimlawan9663 8 месяцев назад
Column names with spaces can sometimes cause issues because R treats spaces as a special character that indicates the end of a command. To solve this, 1. you can use backticks to specify column names with spaces (e.g., ggplot(data, aes(x = `Age group`, y = Value)), 2. you can rename the column (e.g., data$Age_group
@DFK_data
@DFK_data 8 месяцев назад
Thanks!
@moluscosm
@moluscosm Год назад
I LOVE YOU
@DFK_data
@DFK_data Год назад
Thanks!
@ren.auguste2200
@ren.auguste2200 4 месяца назад
Excellent video! If I may ask, do you have any for species accumulation curves? Or know where can point me in the right direction? Hoping you have one, as you explained so well!
@DFK_data
@DFK_data 4 месяца назад
Thank you! No I haven't done a video on species accumulation curves but perhaps a good idea for a future video.
Далее
Bar Charts with {ggplot2}
13:38
Просмотров 4,8 тыс.
Barplot and column plot using R (ggplot)
13:03
Просмотров 26 тыс.
Making a bar graph in RStudio (ggplot2)
11:48
Просмотров 6 тыс.
Data visualization with R in 36 minutes
36:16
Просмотров 24 тыс.
Make Pivot Table from Multiple Sheets in Excel
12:35
Просмотров 272 тыс.
Multi-Panel Plots in R (using ggplot2)
12:18
Просмотров 37 тыс.
Bar charts and Histograms using ggplot in R
18:22
Просмотров 63 тыс.
Recycled Car Tyres Get a Second Life! ♻️
0:58
Просмотров 23 млн
Застрявшее Кольцо 🤯
0:26
Просмотров 5 млн