-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSharkTankGenderGraph.Rmd
42 lines (32 loc) · 1.29 KB
/
SharkTankGenderGraph.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
title: "SharkTankAssistantGenderBarChart"
author: "Aditi Mukkara"
date: "2023-10-20"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(magrittr)
library(dplyr)
library(ggplot2)
SharkTankUSdataset <- read.csv("Downloads/SharkTankUSdataset.csv")
gender_data <- SharkTankUSdataset %>%
rename(Gender = 'Pitchers Gender') %>%
filter(!is.na(Gender)) %>%
group_by(Industry, Gender) %>%
summarise(count = n())
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r cars}
genderGraph <- ggplot(gender_data, aes(x = Industry, y = count, fill = Gender)) +
geom_bar(stat = "identity", position = "dodge") +
labs(title = "Gender Distribution by Industry",
x = "Industry",
y = "Count") +
scale_fill_manual(values = c("Female" = "blue", "Male" = "red", "Mixed Team" = "purple")) +
theme_minimal() +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
plot(genderGraph)
```