I know this probably is basic, but my efforts keep failing. Here's my problem.
I have a large dataframe with 50+ columns, two of which are "year" and "unique individual tag numbers". The dataframe has several 1000 entries, and most, but not all individual numbers are repeated over years. I need a synthax that:
- Removes all lines with NAs in any of these two columns.
- First task: Aggregates the number of unique individual numbers within each year
- Second task: For each individual number, repeat the years it occurs
dataframe = df
year variable = YEAR
unique individual number = IND