My data look like this:
round <- c(rep(\"A\", 3), rep(\"B\", 3)) experiment <- rep(c(\"V1\", \"V2\", \"V3\"), 2) results <- rnorm(mean = 10, n = 6)
You can use the unite function from tidyr
unite
tidyr
require(tidyverse) df %>% unite(round_experiment, c("round", "experiment")) round_experiment results 1 A_V1 8.797624 2 A_V2 9.721078 3 A_V3 10.519000 4 B_V1 9.714066 5 B_V2 9.952211 6 B_V3 9.642900