sum(n==0)>2))
> Peter Maclean
> Department of Economics
> UDSM
>
>
>
> - Original Message
> From: Duncan Murdoch <>
> To: Peter Maclean <>
> Cc:
> Sent: Wed, June 29, 2011 3:33:25 PM
> Subject: Re: [R] DROP OBSEVATION IN A GROUP
>
> On 29/0
I tried this but did not work:
z0<- by(z, z[,"n"], function(x) subset(x, sum(n==0)>2))
Peter Maclean
Department of Economics
UDSM
- Original Message
From: Duncan Murdoch
To: Peter Maclean
Cc: r-help@r-project.org
Sent: Wed, June 29, 2011 3:33:25 PM
Subject: Re: [R]
On 29/06/2011 4:29 PM, Peter Maclean wrote:
People with more experience in R I need help on this.
I would like to drop observation if they meet certain condition. In this example
I would like to drop group 2 in "n" because the group in "Y" has more than 2
zeroes.
#Example
n<- c(1, 1, 1, 1, 1, 1,
People with more experience in R I need help on this.
I would like to drop observation if they meet certain condition. In this
example
I would like to drop group 2 in "n" because the group in "Y" has more than 2
zeroes.
#Example
n <- c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,3)
y <-
4 matches
Mail list logo