No video

How to Import, Manipulate & Visualize Data Using the tidyverse in R | readr, dplyr & ggplot2 Package

  Рет қаралды 1,476

Statistics Globe

Statistics Globe

Күн бұрын

This video demonstrates how to import, manipulate, and visualize data using the tidyverse in the R programming language. The video is part of a teaser series for the Statistics Globe online course on "Data Manipulation in R Using dplyr & the tidyverse". More info: statisticsglob...
Attribution: The data used in this video is taken from here www.kaggle.com...
R code of this video:
install.packages("tidyverse") # Install tidyverse packages
library("tidyverse") # Load tidyverse packages
my_path <- "D:/Dropbox/Jock/Data Sets/" # Specify directory path
tib_dest <- read_csv(str_c(my_path, # Import CSV file
"Most_Visited_Destination_in_2018_and_2019.csv"))
tib_dest # Print tibble
tib_dest %>% # Class of data set
class()
tib_dest %>% # Show entire data set
View()
tib_dest_new <- tib_dest %>% # Rename column
rename(T2019 = `International tourist arrivals (2019)`)
tib_dest_new # Print updated tibble
tib_dest_new2 <- tib_dest_new %>% # Remove certain columns
select(- ...1, - `International tourist arrivals (2018)`)
tib_dest_new2 # Print updated tibble
tib_dest_new3 <- tib_dest_new2 %>% # Replace values
mutate(across(everything(), ~ replace(., . == "-", NA)),
T2019 = as.numeric(str_replace(T2019, " million", "")) * 1e6)
tib_dest_new3 # Print updated tibble
tib_dest_new4 <- tib_dest_new3 %>% # Remove NA rows
na.omit()
tib_dest_new4 # Print updated tibble
tib_dest_new5 <- tib_dest_new4 %>% # Remove duplicate row
filter(Destination != "Egypt" | Region == "Africa")
tib_dest_new5 # Print updated tibble
my_ggp <- tib_dest_new5 %>% # Create ggplot2 plot
mutate(Destination = reorder(Destination, - T2019)) %>%
ggplot(aes(x = Destination,
y = T2019,
fill = Region)) +
geom_col() +
theme(axis.text.x = element_text(angle = 90,
hjust = 1,
vjust = 0.5))
my_ggp # Draw ggplot2 plot
tib_dest %>% # Do all at once
rename(T2019 = `International tourist arrivals (2019)`) %>%
select(- ...1, - `International tourist arrivals (2018)`) %>%
mutate(across(everything(), ~ replace(., . == "-", NA)),
T2019 = as.numeric(str_replace(T2019, " million", "")) * 1e6) %>%
na.omit() %>%
filter(Destination != "Egypt" | Region == "Africa") %>%
mutate(Destination = reorder(Destination, - T2019)) %>%
ggplot(aes(x = Destination,
y = T2019,
fill = Region)) +
geom_col() +
theme(axis.text.x = element_text(angle = 90,
hjust = 1,
vjust = 0.25))
Follow me on Social Media:
Facebook - Statistics Globe Page: / statisticsglobecom
Facebook - R Programming Group for Discussions & Questions: / statisticsglobe
Facebook - Python Programming Group for Discussions & Questions: / statisticsglobepython
LinkedIn - Statistics Globe Page: / statisticsglobe
LinkedIn - R Programming Group for Discussions & Questions: / 12555223
LinkedIn - Python Programming Group for Discussions & Questions: / 12673534
Twitter: / joachimschork
Instagram: / statisticsglobecom
TikTok: / statisticsglobe

Пікірлер: 8
@nedlin7934
@nedlin7934 9 ай бұрын
always can learn new useful things from this channel.
@matthias.statisticsglobe
@matthias.statisticsglobe 8 ай бұрын
Thank you so much, what a great feedback! We really appreciate that!
@saimajahan1000
@saimajahan1000 9 ай бұрын
Awesome as usual !!!!
@StatisticsGlobe
@StatisticsGlobe 9 ай бұрын
Thank you so much Saima, looking forward to the start of the course! :)
@dedisetiawan3245
@dedisetiawan3245 8 ай бұрын
thank, how to change the first column to the name of the school? Thanks for the answer.
@cansustatisticsglobe
@cansustatisticsglobe 8 ай бұрын
Hello, Sorry I couldn't get you very well. There is no school information in the dataset. Could you please give some more details? Best, Cansu
@mayankpatel9379
@mayankpatel9379 9 ай бұрын
Can you please tell me how to add features in r studio my data is full of website in need to find is it malicious or benign
@cansustatisticsglobe
@cansustatisticsglobe 9 ай бұрын
Hello! I am not sure if I got your questions very well. Do you want to add new variables/features to the imported dataset? Best, Cansu
ПОМОГЛА НАЗЫВАЕТСЯ😂
00:20
Chapitosiki
Рет қаралды 29 МЛН
Bony Just Wants To Take A Shower #animation
00:10
GREEN MAX
Рет қаралды 7 МЛН
لااا! هذه البرتقالة مزعجة جدًا #قصير
00:15
One More Arabic
Рет қаралды 52 МЛН
Lubridate - how to manipulate date and time data in R
18:05
R Programming 101
Рет қаралды 10 М.
Describe and Summarise your data
19:44
R Programming 101
Рет қаралды 53 М.
Greenhouse Gas Emissions Analysis | Using Python, Pandas, SQL & Power BI
11:49
need data community
Рет қаралды 1,4 М.
Tidyverse in R - tips & tricks
18:10
Tom Henry - data science with R
Рет қаралды 26 М.
Grouping and Summarizing Data Using dplyr
13:54
weecology
Рет қаралды 10 М.
Explore your data using R programming
25:39
R Programming 101
Рет қаралды 101 М.
ПОМОГЛА НАЗЫВАЕТСЯ😂
00:20
Chapitosiki
Рет қаралды 29 МЛН