Plotting with ggplot2: “Error: Discrete value supplied to continuous scale” on categorical y-axis

后端 未结 3 640
一生所求
一生所求 2020-11-29 04:26

The plotting code below gives Error: Discrete value supplied to continuous scale

What\'s wrong with this code? It works fine until I try to change the s

3条回答
  •  感动是毒
    2020-11-29 04:45

    if x is numeric, then add scale_x_continuous(); if x is character/factor, then add scale_x_discrete(). This might solve your problem.

提交回复
热议问题