Thursday, 15 September 2011

r - Assigning pch symbols in plot -



r - Assigning pch symbols in plot -

i have plot of many omega values within want highlight 40 points among many others. plot argument using is:

plot( log( dog[ order( dog$gbm.dog ) , 8 ] ), pch = ifelse( dog$refseq_mrna %in% dog_omegaplus$refseq_mrna, 2, ifelse( dog$refseq_mrna %in% dog_omegaminus$refseq_mrna, 12, "." ) ) )

i want have 1 grouping of highlighted points triangles (pch = 2), other grouping squares (pch = 12) , other points dots ("."). problem plot produces has digits pch symbols should (specifically "2" there should triangles , "1" there should squares).

how designate symbols correctly?

the problem here using "." coerces 2's , 12's character values. constructed simple test case see happening , whether find numeric designation satisfactory:

x <- 1:20 ifelse(x < 5 , 2, ifelse(x > 15, 12, ".")) [1] "2" "2" "2" "2" "." "." "." "." "." "." "." "." "." "." "." "12" "12" "12" "12" [20] "12" # homecoming integers plot(x, pch= ifelse(x < 5 , 2, ifelse(x > 15, 12, 20)))

r plot pch

No comments:

Post a Comment