Skip to content

Commit

Permalink
Added interactive plots
Browse files Browse the repository at this point in the history
  • Loading branch information
sophialecuona committed Jun 27, 2024
1 parent b4e8e6f commit fdaee8c
Show file tree
Hide file tree
Showing 4 changed files with 3,929 additions and 2 deletions.
5 changes: 4 additions & 1 deletion globalprep/le/v2024/Dustin_wb_service_dataprep.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,16 @@ proportional_employement_nona <- jobs_wages_proportional_employment %>%
ggplot(proportional_employement_nona, aes(x = year, y = proportional_tourism_employment, color = rgn_id)) +
geom_line()
line_plot <- plotly::plot_ly(proportional_employement_nona, x = ~year, y = ~proportional_tourism_employment, color = ~admin_country_name.x, type = "scatter", mode = "lines")
library(plotly)
line_plot <- plot_ly(proportional_employement_nona, x = ~year, y = ~proportional_tourism_employment, color = ~admin_country_name.x, type = "scatter", mode = "lines") %>%
layout(title = "All Regions: Proportional Employment Line Chart",
xaxis = list(title = "Year"),
yaxis = list(title = "Number of people employed by the tourism sector"))
line_plot
htmlwidgets::saveWidget(line_plot, file = "proportional_jobs.html")
penona_pivot <- proportional_employement_nona %>%
pivot_longer(cols = c(proportional_tourism_employment, yearly_wages_ppp_adjusted_by_year), names_to = "metric", values_to = "value")
Expand Down
4 changes: 3 additions & 1 deletion globalprep/le/v2024/jobs_dataprep.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ jobs_plot <- jobs_rgn_join %>%
labs(title = "Number of people employed by the tourism sector")
line_plot <- plot_ly(jobs_rgn_join, x = ~as.numeric(year), y = ~jobs, color = ~admin_country_name, type = "scatter", mode = "lines") %>%
layout(title = "All Regions: Job Line Chart",
layout(title = "All Regions: Tourism Jobs",
xaxis = list(title = "Year"),
yaxis = list(title = "Number of people employed by the tourism sector"))
line_plot
htmlwidgets::saveWidget(line_plot, file = "liv_jobs.html")
```

```{r}
Expand Down
Loading

0 comments on commit fdaee8c

Please sign in to comment.