Re: [R] Select part of character row name in a data frame

2017-10-20 Thread Francesca PANCOTTO
I did not need to select the whole character sentence, otherwise I would know how to do it.. from basic introduction to R as you suggest. Grep works perfectly. f. -- Francesca Pancotto, PhD > Il giorno 19 ott 2017, alle ore 18:01, Jeff Newmiller >

Re: [R] Select part of character row name in a data frame

2017-10-19 Thread Jeff Newmiller
(Re-)read the discussion of indexing (both `[` and `[[`) and be sure to get clear on the difference between matrices and data frames in the Introduction to R document that comes with R. There are many ways to create numeric vectors, character vectors, and logical vectors that can then be used

Re: [R] Select part of character row name in a data frame

2017-10-19 Thread Francesca PANCOTTO
Thanks a lot, so simple so efficient! I will study more the grep command I did not know. Thanks! Francesca Pancotto > Il giorno 19 ott 2017, alle ore 12:12, Enrico Schumann > ha scritto: > > df[grep("strat", row.names(df)), ] [[alternative HTML version

Re: [R] Select part of character row name in a data frame

2017-10-19 Thread Enrico Schumann
Quoting Francesca PANCOTTO : Dear R contributors, I have a problem in selecting in an efficient way, rows of a data frame according to a condition, which is a part of a row name of the table. The data frame is made of 64 rows and 2 columns, but the row names are