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
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.
>
>
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,
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
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)
5 matches
Mail list logo