[R] help filtering points from a scatterplot

Dallas tad.dallas at drakeresearchlab.com
Fri Feb 24 19:13:25 CET 2012


Okay. I think I understand now. You would just like nothing to be plotted for
the points below a certain threshold but there will still be that space
indexing where the point would've gone. I hope I have this right. 

So what you could do to fix that is to make a new matrix (still including
all the data) and then make values above a certain threshold NA. 


#Make up some data 
> a=seq(1,100,by=1) 
> b=runif(100,0,0.5) 

#Make a matrix 
> matrix=cbind(a,b) 

#Make values above a threshold = NA
> newmatrix=matrix
> newmatrix[,2][which(newmatrix[,2]<0.1)]<-NA

#Plot values 
>  plot(newmatrix[,2]~newmatrix[,1], ylim=c(0,1), las=1, ylab='Explan',
> xlab='Window') 


Okay. You just solved it. I'll still post this if you would like to use it. 

Tad


--
View this message in context: http://r.789695.n4.nabble.com/help-filtering-points-from-a-scatterplot-tp4415833p4418169.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list