So currently I have 2 separate geom_histograms that I've created and wanting to combine both into one geom_histogram. Essentially the blue graph lines up in parallel with the red graph below so that I could see that some sort of comparison per each x-axis value:
#First histogram on importance of science
```{r}
lab_data_science <- filter(lab_data, lab_data$V202310 >=2)
science_importance_hist <- lab_data_science %>%
ggplot() +
aes(x = V202310) +
geom_histogram(position = 'dodge', bins = 4, fill='blue') +
labs(
title = 'Importance of Science in Decisions About COVID-19',
subtitle = '2 = Little Important, 3 = Moderately Important, 4 = Very Important, 5= Extremely Important',
x = 'Importance Scale (2 to 5)',
y = 'Count',
fill = 'Republican'
)
science_importance_hist
```
Histogram#1 Results Photo Below: C:\Users\Austin Jin\Desktop\pic1.PNG
#Second histogram on Disapprovals of Governor Handling COVID-19
```{r}
lab_data_science2 <- filter(lab_data, lab_data$V201147x >= 1)
governor_covid_disapprovals_hist <- lab_data_science %>%
ggplot() +
aes(x = V201147x) +
geom_histogram(position = 'dodge', bins = 4, fill= 'red') +
labs(
title = 'Approvals and Disapprovals of Governor Handling COVID-19',
subtitle = '1 = Approve Strongly, 2 = Approve Not Strongly, 3 = Disapprove Not Strongly, 4= Disapprove Strongly',
x = 'Approval Scale (1 to 4)',
y = 'Count',
fill = 'Republican'
)
governor_covid_disapprovals_hist
```
Histogram#2 Results Photo Below: C:\Users\Austin Jin\Desktop\pic2.PNG
Any insights would be greatly appreciated as I've been struggling to combine both histograms into one histogram for side-by-side comparison purposes. Much thanks in advance and will make sure to nicely reward those who provide an accurate response!