The aim of the reproducible example is so that others can help you without trying to reproduce your code.
This is sort of what is useful (slightly modified):
df <- data.frame(stringsAsFactors=FALSE,
Sample.ID = c("Replicate", "Pin Number", "240", "241", "242", "243", "244",
NA, "1293", "1294", "1295", "1296", "1297", "1298", "1299",
"Dilution Factor", "Sample Weight", "Time of Analysis"),
spectrum1 = c(1, NA, 0, 1.221127, 1.211973, 1.201275, 1.190714, NA,
0.999164, 0.994434, 0.987079, 0.978832, 0, 0, 0, 1, NA,
42979.31),
spectrum2 = c(1, NA, 0, 1.234181, 1.224474, 1.21317, 1.202022, NA, 0.945079,
0.939917, 0.940604, 0.947709, 0, 0, 0, 1, NA, 42979.31),
spectrum3 = c(1, NA, 0, 1.194771, 1.186408, 1.176557, 1.166929, NA,
0.980991, 0.975257, 0.973154, 0.975815, 0, 0, 0, 1, NA,
42979.31)
)
> df
Sample.ID spectrum1 spectrum2 spectrum3
1 Replicate 1.000000 1.000000 1.000000
2 Pin Number NA NA NA
3 240 0.000000 0.000000 0.000000
4 241 1.221127 1.234181 1.194771
5 242 1.211973 1.224474 1.186408
6 243 1.201275 1.213170 1.176557
7 244 1.190714 1.202022 1.166929
8 <NA> NA NA NA
9 1293 0.999164 0.945079 0.980991
10 1294 0.994434 0.939917 0.975257
11 1295 0.987079 0.940604 0.973154
12 1296 0.978832 0.947709 0.975815
13 1297 0.000000 0.000000 0.000000
14 1298 0.000000 0.000000 0.000000
15 1299 0.000000 0.000000 0.000000
16 Dilution Factor 1.000000 1.000000 1.000000
17 Sample Weight NA NA NA
18 Time of Analysis 42979.310000 42979.310000 42979.310000
> t(df)
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
Sample.ID "Replicate" "Pin Number" "240" "241" "242" "243" "244" NA "1293" "1294" "1295" "1296" "1297"
spectrum1 " 1.000000" NA " 0.000000" " 1.221127" " 1.211973" " 1.201275" " 1.190714" NA " 0.999164" " 0.994434" " 0.987079" " 0.978832" " 0.000000"
spectrum2 " 1.000000" NA " 0.000000" " 1.234181" " 1.224474" " 1.213170" " 1.202022" NA " 0.945079" " 0.939917" " 0.940604" " 0.947709" " 0.000000"
spectrum3 " 1.000000" NA " 0.000000" " 1.194771" " 1.186408" " 1.176557" " 1.166929" NA " 0.980991" " 0.975257" " 0.973154" " 0.975815" " 0.000000"
[,14] [,15] [,16] [,17] [,18]
Sample.ID "1298" "1299" "Dilution Factor" "Sample Weight" "Time of Analysis"
spectrum1 " 0.000000" " 0.000000" " 1.000000" NA "42979.310000"
spectrum2 " 0.000000" " 0.000000" " 1.000000" NA "42979.310000"
spectrum3 " 0.000000" " 0.000000" " 1.000000" NA "42979.310000"
I see what you are trying to do though. You are transposing the csv and then trying to merge the files. I don't have a good solution at the moment though.