[R] select one row from data-frame by name, indirectly (as string)

2010-01-28 Thread Oliver
Hello,

say I have a dataframe   x
and it contains rows  like ch_01, ch_02 and so on.

How can I select those channels iundirectly, by name?

I tried to select the data with get() but get() seems only to work
on simple variables?

Or how to do it?

I need something like that:


name1 - ch_01
name2 - ch_02

selected - function( x, name1)


Any ideas?

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


Re: [R] select one row from data-frame by name, indirectly (as string)

2010-01-28 Thread Oliver

OK, now it works... just using [ and ]  or [[ and ]] works.
I thought have tried it before... why does it workj now and not before?

hmhh


sorry for the traffic

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


Re: [R] select one row from data-frame by name, indirectly (as string)

2010-01-28 Thread David Winsemius


On Jan 28, 2010, at 10:04 AM, Oliver wrote:



OK, now it works... just using [ and ]  or [[ and ]] works.
I thought have tried it before... why does it workj now and not  
before?


Provide your console session and someone can tell you. Failing that,  
you are asking us to read your mind.







David Winsemius, MD
Heritage Laboratories
West Hartford, CT

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