Re: [R] Plotting colour-coded points

2011-01-05 Thread John Kane
With xx as your data.frame library(ggplot2) qplot(a, id, data=xx, color=b) --- On Wed, 1/5/11, ANJAN PURKAYASTHA wrote: > From: ANJAN PURKAYASTHA > Subject: [R] Plotting colour-coded points > To: r-help@r-project.org > Received: Wednesday, January 5, 2011, 2:00 PM > Hi, >

Re: [R] Plotting colour-coded points

2011-01-05 Thread David Winsemius
On Jan 5, 2011, at 2:00 PM, ANJAN PURKAYASTHA wrote: Hi, I have a file of the following type: idab 1 0.5 5 2 0.7 15 3 1.6 7 40.5 25 I would like to plot the data in column a on the y-axis and the corresponding data in column id o

Re: [R] Plotting colour-coded points

2011-01-05 Thread Jorge Ivan Velez
Hi Anjan, Try something along the lines of d$bb <- with(d, cut(b, c(0,9,19,29))) with(d, plot(a, id, col = bb, pch = 16, las = 1)) legend('topright', as.character(levels(d$bb)), col = 1:length(levels(d$bb)), ncol = 3, pch = 16) where 'd' is your original data.frame. HTH, Jorge On Wed, Jan 5,

[R] Plotting colour-coded points

2011-01-05 Thread ANJAN PURKAYASTHA
Hi, I have a file of the following type: idab 1 0.5 5 2 0.7 15 3 1.6 7 40.5 25 I would like to plot the data in column a on the y-axis and the corresponding data in column id on the x-axis, so plot(a~id). However I would like to col