You'd probably start out by reading your data from the CSV file that you have:
df <- read.csv("FLOCKSIZES.csv")
The following example shows how you can get your data in the form you need. Please note that this example generates random data at the beginning because you haven't provided any data so far. If you were to use read.csv
like in the above example, you could skip the first portion and continue right away from where the measurements are being concatenated:
# Some random data similar to what you'd get from read.csv.
numSamples <- 50
df <- data.frame(time=1:numSamples,
group1=rnorm(numSamples),
group2=rnorm(numSamples),
group3=rnorm(numSamples))
# Concatenate all measurements.
measurements <- c(df$group1, df$group2, df$group3)
# Create a vector that encodes the corresponding group (1 to 3) for each measurement.
# Note: Here we assume that we have the same number of samples from every group.
groups <- do.call(c, lapply(1:3, function(i) rep(i, numSamples)))
# So that you get an idea of what these vectors look like:
print(measurements)
print(groups)
# And here we go:
aov(groups ~ measurements)