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

Published by 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

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x