使用ggplot

时间:2019-02-04 12:26:52

标签: r ggplot2 scatter-plot

我找不到这个问题的任何答案。

我有一个具有以下格式的数据集:

mtcars %>% 
  mutate(row_number=row_number()) %>% 
  select(row_number, mpg, disp, hp, wt) %>% 
  gather(mpg, disp, hp, wt, key="key", value= "value")

我想制作6个散点图,即使用所有组合,例如mpg vs disp; mpg vs hp等。

enter image description here

0 个答案:

没有答案