Thank you David.

 

From: David Winsemius [via R]
[mailto:ml-node+s789695n4642725...@n4.nabble.com] 
Sent: Tuesday, September 11, 2012 12:53 PM
To: Akkara, Antony (GE Energy, Non-GE)
Subject: Re: Searching from Dataframe.

 


On Sep 11, 2012, at 12:11 AM, Rantony wrote: 


> Hi, 
> i have a dataframe containing some values. 
> for eg:- 
> 
> MyDataFrame<- 
> Name   Age   Place 
> -------    ------    ----------- 
> Aby          12        USA 
> Raj            25        UK 
> Romi        32        ENG 
> Amy         31        IND 
> 
> My requirement what is, i have a search key word[it should search from
all 
> the columns], that i need to find out from this dataframe. If search
keyword 
> found , it should return that particular row and column number. 
> 
> For eg:- My search keyword is "ENG". 
> After searching, it should return particular row & column number. Here
it is 
> " MyDataFrame[3,3] " 


> which(MyDataFrame=="ENG", arr.ind=TRUE) 
     row col 
[1,]   3   3 

You can certainly massage those values in any paste()y expression you
choose. 

-- 
David Winsemius, MD 
Alameda, CA, USA 

______________________________________________ 
[hidden email] 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. 



________________________________

If you reply to this email, your message will be added to the discussion
below:

http://r.789695.n4.nabble.com/Searching-from-Dataframe-tp4642722p4642725
.html 

To unsubscribe from Searching from Dataframe., click here
<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscrib
e_by_code&node=4642722&code=YW50b255LmFra2FyYUBnZS5jb218NDY0MjcyMnwxNTUx
OTQzMDI5> .
NAML
<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_view
er&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.Bas
icNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.tem
plate.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml
-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemai
l.naml>  





--
View this message in context: 
http://r.789695.n4.nabble.com/Searching-from-Dataframe-tp4642722p4642726.html
Sent from the R help mailing list archive at Nabble.com.
        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to