Plot one numeric variable against n numeric variables in n plots

后端 未结 4 1026
难免孤独
难免孤独 2020-11-28 13:44

I have a huge data frame and I would like to make some plots to get an idea of the associations among different variables. I cannot use

pairs(data)
<         


        
4条回答
  •  一个人的身影
    2020-11-28 14:35

    The package tidyr helps doing this efficiently. please refer here for more options

    data %>%
      gather(-y_value, key = "some_var_name", value = "some_value_name") %>%
      ggplot(aes(x = some_value_name, y = y_value)) +
        geom_point() +
        facet_wrap(~ some_var_name, scales = "free")
    

    you would get something like this

提交回复
热议问题