So I narrowed the first error down to 633, and the last 20 rows of that are shown, with 633 being the last row. The only think I can think of is it is the only one that has a lot of zeros, but not all zeros, in the sample names. So I would like to try to find a way to rewrite the function to account for these. Maybe making the Log2 into an if statement, as in if it errors it will replace it with zero. Do you know how I could do that?
dput(tail(dat_633_read_filter,20))
structure(list(Protein.Group.Accessions = c("A0A7U9GI36", "A0A7U9CA74",
"A0A7U9C4Y2", "A0A7U9GKQ1", "CON__P02533;CON__P08779", "CON__P02533;CON__P08779",
"A0A7U9GKD8", "A0A7U9GKD8", "CON__P13645", "CON__P13645", "CON__P13645",
"CON__P13645", "CON__P13645", "A0A7U9GKA0", "A0A7U9GKA0", "A0A7U9GHS1",
"A0A7U9C4E6", "A0A7U9CFZ9", "A0A7U9CFZ9", "A0A7U9CFZ9"), Protein.Description = c("",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", ""), Sequence = c("ALDMSVSK", "ALDQIIAGK", "ALDTIDK",
"ALEDCVK", "ALEEANADLEVK", "ALEEANADLEVK", "ALEEPVR", "ALEEPVR",
"ALEESNYELEGK", "ALEESNYELEGK", "ALEESNYELEGK", "ALEESNYELEGK",
"ALEESNYELEGK", "ALELNLKPIVVINK", "ALELNLKPIVVINK", "ALGEAGLDEIR",
"ALGKNEENISDEIEELIK", "ALGYGTDAEIIEFFGEDER", "ALGYGTDAEIIEFFGEDER",
"ALGYGTDAEIIEFFGEDER"), Quan.Usage = c("Used", "Used", "Used",
"Used", "Used", "Used", "Used", "Used", "Used", "Used", "Used",
"Used", "Used", "Used", "Used", "Used", "Used", "Used", "Used",
"Used"), Quan.Info = c("Unique", "Unique", "Unique", "Unique",
"Unique", "Unique", "Unique", "Unique", "Unique", "Unique", "Unique",
"Unique", "Unique", "Unique", "Unique", "Unique", "Unique", "Unique",
"Unique", "Unique"), Isolation.Interference = c(0.121812939,
0.152421013, 0.056531879, 0.164104334, 0.09729899, 0.083573197,
0.025195125, 0.012130391, 0.059432489, 0.208410884, 0.02243324,
0.132142199, 0.100807901, 0.424468934, 0.176699674, 0.160085462,
0.209427118, 0.007959622, 0.020562568, 0.122213884), pH8_2000_13_a = c(72853,
34546, 74807, 140720, 7309.9, 31725, 22834, 37400, 13515, 54315,
58018, 16663, 36854, 6023.5, 23951, 63488, 5181.2, 9336.8, 12941,
0), pH8_2000_13hr_b = c(87450, 38854, 62004, 133310, 5346.8,
32758, 20210, 41142, 12987, 53091, 58464, 15008, 36435, 8024.4,
27715, 64356, 6987.2, 10002, 12387, 0), pH8_2000_13_c = c(80360,
23501, 50560, 100130, 2526.2, 22959, 15354, 30617, 5908, 24034,
23035, 6915.9, 15825, 5216.5, 16132, 47792, 6703.2, 4809, 5144.5,
0), pH8_6_13_a = c(55169, 10738, 132360, 227160, 12396, 46735,
21307, 28600, 57653, 173950, 256810, 66587, 208650, 4793.3, 20118,
111280, 5124.6, 8340.5, 12563, 829.5), pH8_6_13hr_b = c(61660,
19035, 134340, 235160, 12036, 44813, 25962, 41062, 27004, 105460,
102690, 36809, 79315, 6033.7, 19248, 97586, 4527.8, 7821.5, 7817.6,
788.21), pH8_6_13_c = c(73760, 22573, 108470, 202340, 7710.7,
37366, 19867, 37095, 23112, 67877, 95133, 23905, 67220, 8025.5,
20365, 73649, 6158.8, 8054.3, 11446, 206.92), pH8_0_13_a = c(69610,
31793, 90787, 194350, 4037.5, 21813, 19871, 35174, 6499.6, 34327,
22217, 8273.2, 12684, 5487.5, 18359, 59150, 5187.6, 6093.7, 7739.5,
0), pH8_0_13hr_b = c(79237, 31188, 47736, 85897, 5878, 33282,
17516, 35146, 12537, 51438, 57280, 14006, 33004, 7217.7, 23481,
53355, 4329.2, 7928.9, 9001.3, 0), pH8_0_13_c = c(71563, 40383,
41495, 57775, 3951.7, 28924, 6415.1, 11918, 8963.7, 35780, 46012,
10077, 27242, 6771.8, 21368, 54668, 7079.7, 6173, 5578.8, 0),
pH7_2000_13_a = c(54481, 8352.8, 158970, 220590, 13724, 54281,
23017, 34165, 40801, 126290, 154520, 47351, 120390, 6345.8,
17409, 119920, 6930.4, 10171, 14529, 738.75), pH7_2000_13hr_b = c(40545,
8997.8, 115910, 193740, 6614.8, 28276, 22665, 40459, 15964,
56364, 48113, 21261, 40574, 4217.5, 17232, 74088, 3528.7,
7458.7, 8574, 732.33), pH7_2000_13_c = c(65621, 19377, 147300,
253690, 21768, 47616, 20736, 39613, 20938, 73442, 90697,
28707, 75278, 6149.6, 20988, 70256, 5376.1, 7457.9, 9622.5,
0), pH7_6_13_a = c(59654, 25595, 122020, 227650, 7099.8,
27740, 17162, 27811, 14681, 50057, 68354, 17730, 42149, 5913.6,
16891, 51806, 4257.2, 7112.3, 11811, 0), pH7_6_13hr_b = c(77605,
35332, 35041, 68064, 2823.2, 25925, 14831, 31245, 7809.9,
34378, 37870, 10298, 20248, 6978.2, 22288, 49065, 7553.2,
8143.9, 14074, 0), pH7_6_13_c = c(78913, 36268, 44843, 73276,
2556, 26009, 13997, 27511, 8973.1, 35597, 29691, 11362, 17257,
5970, 23272, 61506, 6839.7, 5779.3, 6337.6, 0), pH7_0_13_a = c(42483,
7926.6, 185310, 271430, 15136, 42609, 22539, 36518, 39565,
128850, 191530, 52931, 151600, 4869.2, 16137, 105450, 5983.4,
9818.7, 11390, 857.11), pH7_0_13hr_b = c(57464, 16774, 124630,
201820, 7425.5, 39364, 21493, 37866, 22198, 73302, 75753,
30056, 63786, 6631.3, 19492, 89763, 4874.8, 8272.1, 11433,
297.81), pH7_0_13_c = c(66782, 18441, 145430, 283190, 13759,
43585, 25451, 43414, 29930, 94455, 137840, 36109, 113420,
4929.9, 20519, 79931, 5363, 9468.8, 12911, 259.15)), row.names = c(603L,
608L, 609L, 611L, 612L, 613L, 615L, 616L, 618L, 620L, 621L, 622L,
623L, 625L, 626L, 629L, 630L, 631L, 632L, 633L), class = "data.frame")