Hi suppose I have a dataframe like this.
df = data.frame (
sample= c("a","b","c","d"),
type = c("orange", "apple","carrots", NA)
)
What I want is to keep d in the x-axis but because the type is NA I want to be just an empty space there. Curently because of the NA ggplot literally creates a group call NA.
ggplot(data=df,
aes(x=sample, y= type , na.rm = TRUE ) )+
geom_point(aes(color = as.factor(type) ), size = 20, na.rm = TRUE) +
xlab("") + ylab("")