I am starting with 6 different lists/csvs that each contain one charater column. This column shows the Home Owner Loan Corporation (HOLC) neighborhood grades of census block groups. So the columns look something like shown below. I am new to using R studio and I am wondering if the first step would be to combine the lists. Another option could be to add a new binary column to each list that identifies a column as a 1 if it is not NA and 0 if it is. Then each of the lists can can condense into the categories A, B, C, D, and NA and the new binary column can be summed.
Ideally I am interested in using ggplot but I am open to other options. Thanks for your help! I appreciate it.
Example image of how I would like the results to look. In this example, each line represents a different list/csv table:
houston_grade2020 |
---|
NA |
NA |
B |
A |
NA |
C |
D |
minneapolis_grade2020 |
---|
A |
NA |
NA |
B |
C |
C |
D |
houston_grade1990 |
---|
B |
B |
B |
A |
A |
C |
D |
minneapolis_grade1990 |
---|
B |
A |
NA |
A |
NA |
NA |
D |
etc.
(I started by working with one csv to try and visualize it but alas it did not work. In this example, I did not add the binary column.)
# Group by Grade
Houston_2020_group <-
data.frame(
values = c(Houston_2020_sub$houston_grade2020),
group = c(rep("Houston 2020", nrow(Houston_2020_sub)))
)
ggplot(data = Houston_2020_group, aes(x = values, y = group, fill = group)) +
geom_line()+
lab(title="HOLC Grades")
results:
In this example, I failed to sum the count of the appearances of each grade. For the final result I would like all lists/csvs to be represented in the graph.