I'm making a Jitter figure related to real estate. The variables plotted are the building and the delinquency status ( for ex. too small, small, medium, high, too high), which is a factor. In the data set, I also have the name of the resident and the balance he owes.
This is the chart:
I want to add the name of the resident that is included on this chart.
I tried to use:
geom_text(aes(label=resident))
I have used this before, but it seems is not working, it is showing me this warning.
In argument: balance = as.integer(gsub("\\$", "", balance))
Name of the respective should be aside the dot. This is the code:
eigpm %>% clean_names() %>%
mutate(d_status = str_sub(eigpm$Delinquency.Status,1,2)) %>%
mutate(balance = as.integer(gsub("\\$", "", balance)),
d_status = as.integer(d_status)
) %>%
mutate(property_name = as.factor(property_name)) %>%
mutate(delinquency_status = as.factor(delinquency_status)) %>%
arrange(desc(balance)) %>%
filter(! is.na(delinquency_status)) %>%
filter(delinquency_status!="") %>%
ggplot(aes(x=property_name, y=d_status, color=property_name, size=balance)) +
geom_jitter(alpha=0.5) +
scale_y_continuous(breaks = c(1:11)) +
theme(axis.text.x = element_text(angle=90),
legend.position = "bottom") +
labs(x= "Properties", y="Delinquency Status") +
guides(color=F) +
geom_text(aes(label=resident))