Warning: package 'ggplot2' was built under R version 4.4.2
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.5.1 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.1
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(dslabs)
Warning: package 'dslabs' was built under R version 4.4.3
library(highcharter)
Warning: package 'highcharter' was built under R version 4.4.3
Registered S3 method overwritten by 'quantmod':
method from
as.zoo.data.frame zoo
Attaching package: 'highcharter'
The following object is masked from 'package:dslabs':
stars
library(plyr)
Warning: package 'plyr' was built under R version 4.4.3
------------------------------------------------------------------------------
You have loaded plyr after dplyr - this is likely to cause problems.
If you need functions from both plyr and dplyr, please load plyr first, then dplyr:
library(plyr); library(dplyr)
------------------------------------------------------------------------------
Attaching package: 'plyr'
The following objects are masked from 'package:dplyr':
arrange, count, desc, failwith, id, mutate, rename, summarise,
summarize
The following object is masked from 'package:purrr':
compact
hchart(research_long, "heatmap", hcaes(x = discipline, y = measurements, value = values), name="Percent") |>hc_xAxis(title =list(text ="")) |>hc_yAxis(title =list(text ="")) |>hc_title(text ="Women vs Men in Research Funding") |>hc_caption(text ="van der Lee R, Ellemers N. Gender contributes to personal research funding success in The Netherlands. Proc Natl Acad Sci U S A. 2015 Oct 6") |>hc_colorAxis(stops =color_stops(n =5, colors =c("#000004", "#57106e", "#bc3754", "#f98e09", "#fcffa4")))
The data set I chose gave the total applicants, awards, and success rates for funding in a variety of scientific disciplines. It also gave these variables when separating applicants by gender. It is slightly unclear but I believe success rates refers to success in receiving funding. I calculated what percentage of the applicants and reward recipients were either men or woman to make it easier to compare between genders. I then made a heatmap with highcharter with scientific discipline on the x-axis. Based on the heatmap it is clear that some disciplines have far more even gender distributions than others (social sciences is nearly half and half while physics consists of around 10% women). Success rates are largely similar across disciplines and between the genders. I would like to improve this plot by rounding the numbers in the tooltip and removing the “x, y:” from the tooltip.