I am using R to calculate the mean values of a column in a file like so:
R
file1 = read.table(\"x01\")
mean(file1$V4)
However I have no experie
This is similar to what @jmsigner has done, but with minor changes. For instance, writing to a file is done at the end. The code has not been tested.
out <- lapply(list.files(), FUN = function(x) {
m <- mean(read.table(x, header = TRUE)$V4)
return(m)
})
result <- do.call("cbind", out) #merge a list column-wise
# before writing, you can make column names pretty with colnames()
# e.g. colnames(result) <- c("x01", "x02")
write.table(result, file = "means.txt")