I'm relatively new to R therefore apologies if there is an obvious answer to this question.
Basically, I'm analysing samples by FT-IR in duplicates. The data are given in an individual .csv file for each reading. The csv files have two columns (wavelength and absorbance), and around 3500 rows due to the varying wavelengths. As the measurements are made in duplicates, there are 30 separate .csv files (2 for each of the 15 samples analysed), called "1.csv","2.csv" ... "30.csv". "1.csv" and "2.csv" are both duplicates of sample 1, "3.csv" and "4.csv" of sample 2 and so on.
I need to use the mean absorbance value for each duplicate in the ChemoSpec package. I could obviously calculate this in excel, however this would be time consuming in the future when I have more samples to analyse. Is there a way of calculating these means in R?
Here is a simplified reproducible example, where csv1 and csv2 are both replicates of the sample sample:
wavelength <- c(500, 550, 600)
absorbance <- c(2, 4, 3)
csv1 <- data.frame(wavelength, absorbance)
csv2 <- data.frame(wavelength, absorbance)
mean <- (csv1+csv2)/2
I think I need to read the csv files into R, before calculating the mean values of each sample in a similar way to the above, however I am not sure how to do this.
Thanks.