library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
Apartment_no <- c("1-SV","1-SV","1-SV","1-SH","1-SH","1-SH","1-1V","1-1V","1-1V","1-1H","1-1H","1-1H","3-SV","3-SV","3-SV","3-1V","3-1V","3-1V","3-1H","3-1H","3-1H")
month <- c("September","October","November","September","October","November","September","October","November","September","October","November","September","October","November","September","October","November","September","October","November")
Days <- c("2","19","28","2","19","28","2","19","28","2","19","28","25","31","28","12","13","24","8","26","19")
Heat_data <- data.frame(Apartment_no,month,Days)
I am given the following data. I just wanted to plot it in the most effective way so that I can know for which apartment, & for for how many days, I have the data corresponding to which month. I just want my readings to appear as dots on the graph. So far, I tried the following 3 codes but they really haven't worked in my case.
>Heat_data%>%ggplot()+geom_point(aes(x=month,y=Apartment_no),col="red")+geom_point(x=month,y=Days,col="blue")+scale_y_continuous(name = expression("Apartment_no"),sec.axis = sec_axis(name = "Days"))
> Heat_data%>%ggplot()+geom_point(mapping = aes(x=month,y=Apartment_no,size=3,shape=21,fill="blue"))+scale_y_continuous(name = expression("Apartment_no"),sec.axis = sec_axis(name = Days))
>p <- ggplot(Heat_data,aes(month,Apartment_no))+geom_point()
p+scale_y_continuous(sec.axis = sec_axis(Days))
Furthermore I also tried something with facet_wrap, but it gives me a weird graph which is not understandable.
>Heat_data%>%ggplot(aes(month,value,fill=Apartment_no))+geom_col()+coord_flip()+facet_wrap(~Apartment_no)
Also I want the dots to appear highlighted with red color where ever my days reading falls below 8.