I want to create a variable that include all numbers between (startyear) and (endyear - 1). My data looks like this:
| country | leader | startyear | endyear |
|---|---|---|---|
| US | Eisenhower | 1953 | 1961 |
| US | Kennedy | 1961 | 1963 |
I want to show my data like this:
| country | leader | startyear | endyear | year |
|---|---|---|---|---|
| US | Eisenhower | 1953 | 1961 | 1953 |
| US | Eisenhower | 1953 | 1961 | 1954 |
| US | Eisenhower | 1953 | 1961 | 1955 |
| US | Eisenhower | 1953 | 1961 | 1956 |
| US | Eisenhower | 1953 | 1961 | 1957 |
| US | Eisenhower | 1953 | 1961 | 1958 |
| US | Eisenhower | 1953 | 1961 | 1959 |
| US | Eisenhower | 1953 | 1961 | 1960 |
| US | Kennedy | 1961 | 1963 | 1961 |
| US | Kennedy | 1961 | 1963 | 1962 |
I have many countries in data set. I want to manipulate all data set with "the" code.