Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201945

R Read (Excel, txt...) rows and columns with conditions

$
0
0

Supose I have this dataframe in a .dta, .txt or excel file:

ID fondo
1  colf
2  colf
3  prot
4  colf
5  porv
6  prot
7  porv
8  colf
9  colf
10  colf

I would like to read this file just the column 1 (ID) and the rows where fondo == "colf". Then the final dataframe I would have in my R enviroment would be something like this:

ID
1
2
4
8
9
10

Viewing all articles
Browse latest Browse all 201945

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>