# Create a tidy data frame with two samples, five concentrations, three
# replicates, and five time points
samples <- c("Sample 1", "Sample 2")
concentrations <- c(0.1, 0.5, 1, 2, 5)
time_points <- c(1, 2, 3, 4, 5)
n_replicates <- 3
df <- expand.grid(
Description = c("Sample 1", "Sample 2"),
Concentration = c(0.1, 0.5, 1, 2, 5),
Time = c(1, 2, 3, 4, 5),
Replicate = 1:3)
df$Value <- abs(rnorm(nrow(df)))
df_formatted <- tidy_to_custom(df)
Run the code above in your browser using DataLab