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 have the data given as above. I would like to plot months on x-axis, Apartment_no on left y-axis and Days on right y-axis. I would like the readings to just appear as Dots on the graph. I have tried the following 3 codes but none of them seems to be working out for me.
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_clean,aes(month,Apartment_no))+geom_point() p+scale_y_continuous(sec.axis = sec_axis(Days))
I also tried something with facet_wrap which can be seen in the following code, but it gave a weird graph which is not understandable.
Heat_data%>%ggplot(aes(month,value,fill=Apartment_no))+geom_col()+coord_flip()+facet_wrap(~Apartment_no)
Furthermore, since I have a large data similar to this, can I highlight the dots in my plot where ever the Days is below 10.