Your objective is to replicate these figures, created using the Cooperative Congressional Election Study data. These figures are similar to those we completed in the lecture videos.
Hints:
For the x-axis, use the variable “ideo5”.
Make sure you recode the data for the “ideo5” variable to generate the correct names for the x-axis. You will want to consult the codebook.
Use the fill aesthetic to have R fill in the bars. You do not need to set the colors manually.
Use guides() to drop the legend.
Make sure the axis labels and figure title are correct.
Hints:
For the x-axis, use the variable “pew_religimp”.
Make sure you recode the data for the “pew_religimp” variable to generate the correct labels for the x-axis. You will want to consult the codebook.
Rename the column for Ideology to make sure the first letter is upper-case (to make the legend appear correctly).
Use the fill aesthetic to have R fill in the bars. You do not need to set the colors manually.
Make sure the axis labels and figure title are correct.
Instructions:
For this visualization, you are creating your own data for practice.
Create a tibble/data frame with three columns: Semester, Student, and Grade.
There should be six semesters and three students (Amanda, Betty, and Carol)
Create grades for the students using the runif() command, with values between 80 and 100. Hint: you’ll need 18 grades total.
The figure should look approximately like this (your vaules will be slightly different):
## # A tibble: 18 × 3
## Semester Student Grade
## <int> <chr> <dbl>
## 1 1 Amada 82.3
## 2 2 Amada 92.4
## 3 3 Amada 92.2
## 4 4 Amada 92.5
## 5 5 Amada 97.2
## 6 6 Amada 92.8
## 7 1 Betty 80.2
## 8 2 Betty 84.7
## 9 3 Betty 93.3
## 10 4 Betty 90.3
## 11 5 Betty 93.9
## 12 6 Betty 90.9
## 13 1 Carol 85.7
## 14 2 Carol 98.5
## 15 3 Carol 85.8
## 16 4 Carol 96.7
## 17 5 Carol 85.7
## 18 6 Carol 85.3