I have a data frame, and I would like to repeat each row in the data frame, changing the region variable each time for every variable in my list.
For example, I have this data frame.
          id  region
1   MG562518   <NA>
2   MG562519   <NA>
3   MG562520   <NA>
4   MG562521   <NA>
5   MG562522   <NA>
I also have this list of states
[1] "AK" "AL" "CT" "MA"
For every id, I need a new row for every state.
       id  region
MG562518   AK
MG562518   AL
MG562518   CT
MG562518   MA
MG562519   AK
MG562519   AL
MG562519   CT
MG562519   MA
MG562520   AK
MG562520   AL
MG562520   CT
MG562520   MA
MG562521   AK
MG562521   CT
MG562521   MA
etc...
I have tried to use joins and I have tried a nested complete function, but it did not work for me.
   arrange(id)
I think the answer is a cartesian join, but I couldn't find how to do that in R. Any advice would be appreciated. Thank you
 
    