I have a table that is a combination of 4 things.
place1 <- c("Florida", "California", "Georgia")
race1 <- c("NHW", "NHB", "Hisp")
race2 <- c("NHW", "NHB", "Hisp")
cancer <- c("Lung", "Liver", "Thyroid")
combos <- expand.grid(place1, race1, race2, cancer, stringsAsFactors = FALSE)
names(combos) <- c("place1", "race1", "race2", "cancer")
I would like to add another column that is called place2
. It needs to hold the value from place1
, "USA", and then "France". That is, I need to take each record and multiply it by 3.
Currently, the first two records are:
The dataframe I want to produce will look like this: