[R] please help ! label selected data points in huge number of data points potentially as high as 50, 000 !

csrabak crabak at acm.org
Sun Mar 6 18:46:19 CET 2011


Em 5/3/2011 21:29, Umesh Rosyara escreveu:
> Dear All
>
> I am reposting because I my problem is real issue and I have been working on
> this. I know this might be simple to those who know it ! Anyway I need help
> !
>
> Let me clear my point. I have huge number of datapoints plotted using either
> base plot function or xyplot in lattice (I have preference to use lattice).
>           name xvar            p
> 1       M1    1  0.107983837
> 2       M2   11  0.209125624
> 3       M3   21  0.163959428
> 4       M4   31  0.132469859
> 5       M5   41  0.086095130
> 6       M6   51  0.180822010
> 7       M7   61  0.246619925
> 8       M8   71  0.147363687
> 9       M9   81  0.162663127
> ........
> 5000 observations
>
> I need to plot xvar (x variable) and p (y variable) using either plot () or
> xyplot(). And I want show (print to graph) datapoint name labels to those
> rows that have p value<  0.01 (means that they are significant). With my
> limited R knowlege I can use text (x,y, labels) option to manually add the
> text, but I have huge number of data point(though I provide just 1000 here,
> potentially it can go upto 50,000). So I want to display name corresponding
> to those observations (rows) that have pvalue less than 0.05 (threshold).
> [snipped]

Umesh,

Given you have been already instructed how to do more or less what you 
intend to, I want to suggest something more simple which given the 
description of your problem seems to me more appropriate:

Create a vector for changing the symbol used to plot the points in the 
scatter diagram:

p.point <- ifelse(p < 0.01,1,19) # for deciding which symbols you want # 
look at example(pch)
plot(xvar, p, , pch=p.points)

HTH

--
Cesar Rabak



More information about the R-help mailing list