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