use spread in R code example Example: r spread syntax Click to copyspread(data, key, value, fill = NA, convert = FALSE, drop = TRUE, sep = NULL)