I want to combind data1
and region
. Currently, I usefor...
,the result as total_df
.
Is there any easier way for this ? Thanks!
data1 <- data.frame(category=c("a","b","c"),
amount=1:3)
region <- data.frame(country=c('US','UK'))
total_df <- data.frame()
for (country in region$country){
data1$region <- country
total_df <- rbind(total_df,data1)
}