Scatter Plot xlim

Hi,
The Question may seems to be a little silly,But I really need your help.I am struck

Question1>In scatterplot in R can we plot a variable containing char in X axes . Or both the axes needs to have numeric value?
Question2: If I am allowed to plot char variable in X axes, then how do I set the parameter xlim?Is xlim always required or can we ommit it

Here is an example, twice, with and without jitter

library(tidyverse)
 
df <- data.frame(x=rep(c("a", "b","c"),10)
                 ,y=sample.int(9,30,replace=TRUE))

ggplot(data=df,
       mapping=aes(x=x,y=y)) + geom_point() 

ggplot(data=df,
       mapping=aes(x=x,y=y)) + geom_jitter(width=.1)

Thanks,it worked perfectly fine

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.