Hi, I have a data.frame and I need to know witch store sold more "Lapiseiras". I got a point where I am almost sure I am very closed to the answer but I am missing somethiing.
So, the data frame is this one dados<-data.frame(Store=c("Setubal","lx","Aveiro","Coimbra","Aveiro","Evora","Aveiro","Coimbra","Setubal"),Prod=c("Bloco Desenho","Bloco Desenho","Tinteiro","Régua","Lapiseira","Regua","Tinteiro","Lapiseira","Lapiseira"),qtd=c(2,1,2,1,3,1,1,1,1)) then I do this: dados[dados$Prod=="Lapiseira",c("Store","qtd")] and I get this: Store qtd 5 Aveiro 3 8 Coimbra 1 9 Setubal 1 but the answer I want to obtain is: "Aveiro" can you help me please? thanks AD -- View this message in context: http://r.789695.n4.nabble.com/Help-in-getting-info-from-a-DataFrame-tp3247740p3247740.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@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.