1

I have a data frame like this(showing a part of big data frame)

cell1    0.33   0.003   cell1_sig
cell1   -0.23   0.002   cell1_sig
cell1    0.21   0.08    cell1_nonsig
cell2    0.87   0.0001  cell2_sig
cell2    0.1    0.10    cell2_nonsig

I want to create a scatter plot between cell1 and cell2 for column2. But I have 3 values for cell1 and only 2 values for cell2 as shown in the example data frame. I also want to color the points using 4th column.

I know how to use ggscatter function from the ggpubr package for colors(using palette option), but how can I create a scatter plot for x and y with different lengths?

Here x = cell1 has 3 values and y = cell2 has 2 values.
Any help would be appreciated.

zx485
  • 28,498
  • 28
  • 50
  • 59
user3138373
  • 519
  • 1
  • 6
  • 18
  • You should use ggplot to do this – Vivek Katial Oct 03 '18 at 19:28
  • The "coordinates" of the points are the third column, so the second is useless? Are you going to have a 3d scatter (so you have to decide which is the missing coordinate of the cell2, and which value you want), or a 2d (decide which value of cell1 remove)? – s__ Oct 03 '18 at 19:40
  • Sorry it's the 2nd column for which I have to make a scatter plot. Ignore the third column – user3138373 Oct 03 '18 at 19:43
  • When I see "scatter plot", I think of a diagram using multiple points plotted in 2D space with cartesian coordinates. https://en.wikipedia.org/wiki/Scatter_plot By definition each data point requires 2 coordinates. It sounds like you ight be describing something else; could you please describe more or point to an example? – Jon Spring Oct 04 '18 at 05:54

0 Answers0