0

enter image description here

I'm trying to plot this graph using R but dont know how.

Screenshot of the dataset that I'm using

1
  • 1
    Could you please share some reproducible data using dput? Commented Nov 16, 2022 at 12:17

1 Answer 1

1

You didn't provide the dataset, but you could do something like that

# packages ----------------------------------------------------------------

library(dplyr)
library(ggplot2)

# data --------------------------------------------------------------------

#load your data first
#
#

#get just the last observation for each location
dataset2 <- dataset %>% 
  group_by(location) %>% 
  slice_tail() %>% 
  ungroup()

# plot --------------------------------------------------------------------

dataset2 %>% 
  ggplot(aes(x = continent, y = total_deaths))+
  geom_bar()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.