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

R: dropping all observations within a group

$
0
0

I have a set of 500 firms with investment data over six years. I want to create a balanced panel of ONLY the firms that have data for all six years, but I can't seem to find an easy way to do this in R.

My data looks like:

IMAGE

I want to drop a firm for all years if it has missing values for just one year. I've tried different conditional subsetting commands but nothing is working for me. Ideas?


Viewing all articles
Browse latest Browse all 201839

Trending Articles



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