Plotting NULL values in a Scatter Plot using R

enter image description hereenter image description hereI have a dataset which has 140 rows and 17 columns. I wanna visualize all values including NA in the scatterplot showing Secchi vs Hu Angle. When I did try to visualize it with asthetics such as color, shape and size, it show me only the points which has values. But, it doesnt show null values. I also tried adding 0 instead of Null, and it worked. But, I dont wanna add zero. Is it possible to show all the values including null values. Most of the Null values are in Wave.height field.

I have tried to show NUll values in the plot.I added Zero and median values instead of NA values and it showed me all the values. But, I wanna show all the values including NA values.

final_updated_4 <- read.csv("final_updated_4.csv")
###Outliers###
### Wave height vs Sun vs Wind Speed###
ggplot(final_updated_4, aes(x= hue_angle, y=Secchi))+
  geom_point(aes(shape=Sun, color=Wave.height, size= Wind.speed))+
  ylab("Secchi")+
  xlab("Hue Angle")+
  scale_color_gradientn(colours = rainbow(10), oob = scales::squish)+
  geom_abline(yintercept=0, slope=1, linetype="dashed")+
  theme(legend.background = element_rect(fill = "grey60"),
        legend.text = element_text(size = 12),
        legend.title = element_text(size = 12),
        legend.key.size = unit(1.0, "cm"))+
  geom_smooth(method = "lm") +
  stat_poly_eq(formula = y~x,aes(label = paste(..eq.label.., ..rr.label.., sep = "~~~")), parse = TRUE,
               rr.digits = 5)

Leave a Comment