ggscatter two color issue
1
0
Entering edit mode
6.8 years ago
1769mkc ★ 1.2k
data1  <- AVERAGE_HSC_LSC
data1$HSC <- as.factor(data1$HSC)
library("ggpubr")
ggscatter(data1, x = "HSC", y = "LSC", 
          color = "HSC", shape = "HSC",
          add = "reg.line", conf.int = FALSE, 
          palette = c("#00AFBB"),
          cor.coef = TRUE, cor.method = "pearson",
          color = "black", size=1)

I m getting this error, when i try to plot two color...

Error in ggscatter(data1, x = "HSC", y = "LSC", color = "HSC", shape = "HSC",  : 
  formal argument "color" matched by multiple actual arguments
R • 4.3k views
ADD COMMENT
1
Entering edit mode
6.8 years ago
Chirag Parsania ★ 2.0k

This is because you provided color twice. Can not provide same argument multiple time

ADD COMMENT
0
Entering edit mode

can you tell me how do i just label the samples

p + gradient_color(c("red",  "blue"))

i m using this...but it seems its labelling the genes not the samples...

ADD REPLY
0
Entering edit mode

I don't know your data format. See the example below I created from sample data. You can replicate accordingly. Provide output of head(data1) to generate for your data.

library("ggplot2")
library(ggpubr)
data <- mpg 
ggscatter(data,"cty","hwy",col="trans")
ADD REPLY

Login before adding your answer.

Traffic: 1752 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6