Warning: Using size for a discrete variable is not advised.

Published onesixx on

 

ggplot에서 number가 아닌 변수를 size에 사용했을때 warning

data

df <- data.frame(y=1:5, x=1:5, f=factor(1:5))
  y x f
1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
5 5 5 5

plot

p <- ggplot(df, aes(x=x, y=y, color=f, size=f, shape =f))+ geom_point()
Warning message:
Using size for a discrete variable is not advised

==>

p <- ggplot(df, aes(x=x, y=y, color=f, size=as.numeric(f), shape =f))+ geom_point()

 

 

 

 

 

 

 

 

Categories: Pj

onesixx

Blog Owner

Leave a Reply

Your email address will not be published.