Re: [R] If Command in Plot

2012-09-23 Thread arun
HI, I guess you want to plot with a subset of your data z1. z1[with(z1,e>0),]  plot(y~x,data=z1[with(z1,e>0),]) A.K. - Original Message - From: Bhupendrasinh Thakre To: r-help Cc: Sent: Saturday, September 22, 2012 11:48 PM Subject: [R] If Command in Plot Hi Team, I am try

Re: [R] If Command in Plot

2012-09-22 Thread Bhupendrasinh Thakre
1,e>0),]) > A.K. > > > > > > > - Original Message - > From: Bhupendrasinh Thakre > To: r-help > Cc: > Sent: Saturday, September 22, 2012 11:48 PM > Subject: [R] If Command in Plot > > Hi Team, > > I am trying to very simple plot with command plot. > >

Re: [R] If Command in Plot

2012-09-22 Thread Bhupendrasinh Thakre
Thanks Dr. Heiberger.. that solves my problem. Bhupendrasinh Thakre On Sep 22, 2012, at 10:58 PM, "Richard M. Heiberger" wrote: > Think matrix, not scalar. > > > tmp <- structure(list(x = c(1, 1, 1, 2, 2, 2, 3, 3, 3), y = c(1, 2, > + 3, 1, 2, 3, 1, 2, 3), e = c(0, -1, -2, 1, 0, -1, 2, 1,

Re: [R] If Command in Plot

2012-09-22 Thread Richard M. Heiberger
Think matrix, not scalar. > tmp <- structure(list(x = c(1, 1, 1, 2, 2, 2, 3, 3, 3), y = c(1, 2, + 3, 1, 2, 3, 1, 2, 3), e = c(0, -1, -2, 1, 0, -1, 2, 1, 0)), row.names = c(NA, + -9L), .Names = c("x", "y", "e"), class = "data.frame") > > tmp x y e 1 1 1 0 2 1 2 -1 3 1 3 -2 4 2 1 1 5 2 2 0 6 2

[R] If Command in Plot

2012-09-22 Thread Bhupendrasinh Thakre
Hi Team, I am trying to very simple plot with command plot. Question : I am trying to plot (x,y) based on the value of Column e. If column e value is greater than 0 then plot(x,y) otherwise do not plot it. Data : structure(list(x = c(1, 1, 1, 2, 2, 2, 3, 3, 3), y = c(1, 2, 3, 1, 2, 3, 1, 2, 3)