[R] does there any function like sumif in excel?

John Kane
Mon, 29 Sep 2008 14:20:38 -0000

There are several ways to subset the dataframe
?select will give you one.

or mydata[mydata$A=value]<- mydata

then apply sum()


I do not think there is one single command equivalent to sumif()



--- On Sun, 9/28/08, caocheng?? <caocheng8230 at gmail.com> wrote:

> From: caocheng?? <caocheng8230 at gmail.com>
> Subject: [R] does there any function like sumif in excel?
> To: R-help at r-project.org
> Received: Sunday, September 28, 2008, 10:25 PM
> I have a data.frame datas which have two columns A and B.
> I want to filter column A by some values and to get a value
> list which
> contain the value in B.
> Best wishes!
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained,
> reproducible code.


      __________________________________________________________________
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your
favourite sites. Download it now at