Hello Friends,

I am new to R and stuck with a problem.

i have two columns drug_A and drug_B, i have plotted a scatter plot
using the ggplot2 function.

My problem is with the third column, it is the p-value column.

I want to color and size points differently based on the p_value, the
p_value range is between 0<0.0001< 0.001<0.05<1.

I used a script using the ifelse loop, but it considers only two
conditions at one time.

Please tell me a way to fulfill all the conditions.

here is the script:
library(lattice)

 qplot(Drug_A, Drug_B, data=dsmall, size = p_value, colour =
ifelse(p_value > 0, ">0", "<0.0001"),
+ ifelse(p_value1 > 0.001, ">0.001", "<0.01")
+ ifelse(p_value1 > 0.001, ">0.001", "<0.05"
))

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to