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

  Рет қаралды 16,062

Data For Knowledge

Data For Knowledge

Күн бұрын

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

Пікірлер: 27
@leanne-se2sp
@leanne-se2sp 2 ай бұрын
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 2 ай бұрын
Thank you! Glad the video helped. Good luck with your studies!
@lucacotan4492
@lucacotan4492 10 ай бұрын
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 10 ай бұрын
You're very welcome!
@APerson-ky2gh
@APerson-ky2gh 2 ай бұрын
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 2 ай бұрын
Thank you! Glad the video helped. Good luck with your studies!
@inamhameed4963
@inamhameed4963 Жыл бұрын
Great, well-structured and organized. Much recommended your channel!!!
@DFK_data
@DFK_data Жыл бұрын
Thanks! Much appreciated
@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
@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
@lindalangford320
@lindalangford320 4 ай бұрын
Thanks for such an informative video. It is greatly appreciated.
@DFK_data
@DFK_data 4 ай бұрын
Thank you!
@cristianjesus255
@cristianjesus255 5 ай бұрын
OMG, this video helped me so much!!
@DFK_data
@DFK_data 5 ай бұрын
Thanks! Glad you found the video helpful.
@papito-qf2jj
@papito-qf2jj 11 ай бұрын
thanks alot , it is so helpful
@DFK_data
@DFK_data 11 ай бұрын
Thanks for watching the video! Glad it was helpful.
@pedropuente3761
@pedropuente3761 9 ай бұрын
Love this!
@DFK_data
@DFK_data 9 ай бұрын
Thanks! Glad you enjoyed the video.
@ibrahimlawan9663
@ibrahimlawan9663 9 ай бұрын
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 9 ай бұрын
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
yuzaR Data Science
Рет қаралды 5 М.
Зачем он туда залез?
00:25
Vlad Samokatchik
Рет қаралды 3,2 МЛН
路飞被小孩吓到了#海贼王#路飞
00:41
路飞与唐舞桐
Рет қаралды 81 МЛН
KINDNESS ALWAYS COME BACK
00:59
dednahype
Рет қаралды 169 МЛН
Case Study 2 - Linear Regression - on summarized data - Bike usage Prediction
22:28
Data Science for High School
Рет қаралды 217
Data visualization with R in 36 minutes
36:16
Equitable Equations
Рет қаралды 26 М.
Bar charts and Histograms using ggplot in R
18:22
R Programming 101
Рет қаралды 64 М.
Scatterplots and regression lines in R
15:00
Equitable Equations
Рет қаралды 8 М.
Barplot and column plot using R (ggplot)
13:03
BioinfQuests
Рет қаралды 26 М.
Describe and Summarise your data
19:44
R Programming 101
Рет қаралды 52 М.
iShowSpeed Does a Backflip into the WATER🤯⚡️
0:15
Reidar
Рет қаралды 27 МЛН
Double Stacked Pizza @Lionfield @ChefRush
0:33
albert_cancook
Рет қаралды 82 МЛН
A little girl was shy at her first ballet lesson #shorts
0:35
Fabiosa Animated
Рет қаралды 5 МЛН
Funny Escalator #katebrush #shorts
0:11
Kate Brush
Рет қаралды 6 МЛН