Skip to content
Prev 249169 / 398498 Next

Help in getting info from a DataFrame

Hi

r-help-bounces at r-project.org napsal dne 02.02.2011 11:14:18:
now
Sorry I did not look to your code and used the code I sent you as a 
solution

What do you expect max(lapsales$qtg) give you as a result?
If you changed the number qtd to 4 instead of 3 you will get
[1] <NA>
Levels: Aveiro Coimbra Evora lx Setubal

So R give you what you ask for. You asked for third line and you got it.

If you asked for which position is the maximum number

lapsales[which.max(lapsales$qtd),"Store"]
[1] Aveiro
Levels: Aveiro Coimbra Evora lx Setubal

You will get desired result.

Regards
Petr
("Setubal","lx","Aveiro","Coimbra","Aveiro","Evora","Aveiro","Coimbra","Setubal"),Prod=c
("BlocoDesenho","BlocoDesenho","Tinteiro","R?gua","Lapiseira","Regua","Tinteiro","Lapiseira","Lapiseira"),qtd=c
http://www.R-project.org/posting-guide.html
Message-ID: <OF0CE161C2.B312F39C-ONC125782B.003CB53E-C125782B.003D5D04@precheza.cz>
In-Reply-To: <OFE5C9F1DA.440B4523-ONC125782B.0037FA1F-C125782B.00384BC7@precheza.cz>