Skip to content
Prev 299485 / 398503 Next

Extracting arithmetic mean for specific values from multiple .txt-files

Since you did not provide an example of the file, I will take a guess
at the content and show to to extract the values and take the mean of
all of them since you did not say if you want the mean of each file,
or a single means.

myData <- do.call(c, lapply(1:65, function(.file){
	x <- read.csv(paste0("XYZ_", .file, ".txt"))
	x[15:166, 'colH']
})))

mean(myData)
On Sun, Jul 8, 2012 at 7:01 PM, vimmster <superdodge at gmx.net> wrote:

  
    

Thread (16 messages)

vimmster Extracting arithmetic mean for specific values from multiple .txt-files Jul 8 jim holtman Extracting arithmetic mean for specific values from multiple .txt-files Jul 8 vimmster Extracting arithmetic mean for specific values from multiple .txt-files Jul 9 Rui Barradas Extracting arithmetic mean for specific values from multiple .txt-files Jul 9 vimmster Extracting arithmetic mean for specific values from multiple .txt-files Jul 9 jim holtman Extracting arithmetic mean for specific values from multiple .txt-files Jul 9 Rui Barradas Extracting arithmetic mean for specific values from multiple .txt-files Jul 9 vimmster Extracting arithmetic mean for specific values from multiple .txt-files Jul 10 Rui Barradas Extracting arithmetic mean for specific values from multiple .txt-files Jul 10 vimmster Extracting arithmetic mean for specific values from multiple .txt-files Jul 10 Rui Barradas Extracting arithmetic mean for specific values from multiple .txt-files Jul 10 vimmster Extracting arithmetic mean for specific values from multiple .txt-files Jul 10 vimmster Extracting arithmetic mean for specific values from multiple .txt-files Jul 10 Rui Barradas Extracting arithmetic mean for specific values from multiple .txt-files Jul 11 vimmster Extracting arithmetic mean for specific values from multiple .txt-files Jul 11 vimmster Extracting arithmetic mean for specific values from multiple .txt-files Jul 12