Hi @sharmachetan,
You asked this question some time ago, so you may have an answer already.
Does this help?
suppressPackageStartupMessages(library(tidyverse))
library(crossdes)
#> Loading required package: AlgDesign
#> Loading required package: gtools
set.seed(42)
df <- as.data.frame(williams(3))
df$trt_combination <- paste0(df$V1, df$V2, df$V3)
df$trt_number <- 1:6
df
#> V1 V2 V3 trt_combination trt_number
#> 1 1 2 3 123 1
#> 2 2 3 1 231 2
#> 3 3 1 2 312 3
#> 4 3 2 1 321 4
#> 5 1 3 2 132 5
#> 6 2 1 3 213 6
# Assumes no blocking or structure in subjects 1:80 (e.g sex, age cohort, etc).
# Better to recruit n*6 subjects, e.g. 78 or 84!
subj_df <- data.frame(subject = 1:80,
rand_trt = sample(c(rep(1:6, each=13), 1:2)))
head(subj_df)
#> subject rand_trt
#> 1 1 4
#> 2 2 5
#> 3 3 2
#> 4 4 6
#> 5 5 2
#> 6 6 2
full_df <- left_join(subj_df, df, by=c("rand_trt" = "trt_number"))
head(full_df, n=10)
#> subject rand_trt V1 V2 V3 trt_combination
#> 1 1 4 3 2 1 321
#> 2 2 5 1 3 2 132
#> 3 3 2 2 3 1 231
#> 4 4 6 2 1 3 213
#> 5 5 2 2 3 1 231
#> 6 6 2 2 3 1 231
#> 7 7 4 3 2 1 321
#> 8 8 2 2 3 1 231
#> 9 9 6 2 1 3 213
#> 10 10 3 3 1 2 312
table(full_df$trt_combination)
#>
#> 123 132 213 231 312 321
#> 14 13 13 14 13 13
Created on 2022-11-18 with reprex v2.0.2