I have a data frame in R Studio that has 3 columns: Year, Office, Market Share. I would like to create a new data frame that has the following columns so I may do a regression and see if Market Share is stable year over year:
Year / YearN / YearN+1 / Office
The data frame appears as this:
Year / Office / Market Share
data frame and is 5 years worth of data.
I have tried the unlist function, however was unsuccessful. I am open to suggestions.
Apologies this post might be confusing, first SO post :/