我只是有一个截断和subseted df与一个成对的一组3个变量,每个看起来像这样;
structure(list(UID = c("20210521-3", "20210521-1", "20210521-4",
"20210526-59", "20210526-11", "20210526-62", "20210526-12", "20210526-46",
"20210526-13", "20210526-44", "20210526-33", "20210526-14", "20210526-9",
"20210526-10", "20210526-52", "20210526-56", "20210526-43", "20210526-32",
"20210526-4", "20210526-41", "20210526-48", "20210526-65", "20210526-58",
"20210526-40", "20210526-5", "20210526-38", "20210526-55", "20210526-60",
"20210526-61", "20210526-2", "20210526-1", "20210526-63", "20210526-37",
"20210526-36", "20210526-35", "20210526-8", "20210526-19", "20210526-18",
"20210526-30", "20210526-27", "20210526-26", "20210526-24", "20210526-25",
"20210526-22", "20210526-47", "20210526-31", "20210526-39", "20210526-54",
"20210526-64", "20210526-53", "20210526-21", "20210526-42", "20210526-20",
"20210526-57", "20210526-50", "20210526-15", "20210526-3", "20210526-23",
"20210526-45", "20210526-6", "20210526-34", "20210526-7", "20210526-17",
"20210526-29", "20210526-28", "20210526-51", "20210526-49", "20210536-2",
"20210536-1", "20210521-NA", "20210521-NA", "20210521-NA", "20210521-NA",
"20210521-NA", "20210521-NA", "20210526-NA", "20210526-NA", "20210526-NA",
"20210526-NA", "20210526-NA", "20210526-NA", "20210526-NA", "20210526-NA",
"20210526-NA", "20210526-NA", "20210526-NA", "20210526-NA", "20210526-NA",
"20210526-NA", "20210526-NA", "20210526-NA", "20210526-NA", "20210526-NA",
"20210526-NA", "20210536-NA", "20210536-NA", "20210536-NA", "20210536-NA",
"20210536-NA", "20210536-NA", "20210536-NA", "20210536-NA", "20210536-NA",
"20210536-NA", "20210536-NA", "20210536-NA", "20210536-NA", "20210536-NA",
"20210536-NA", "20210536-NA", "20210536-NA", "20210536-NA", "20210536-NA",
"20210536-NA", "20210536-NA", "20210536-NA", "20210521-3", "20210521-1",
"20210521-4", "20210526-59", "20210526-11", "20210526-62", "20210526-12",
"20210526-46", "20210526-13", "20210526-44", "20210526-33", "20210526-14",
"20210526-9", "20210526-10", "20210526-52", "20210526-56", "20210526-43",
"20210526-32", "20210526-4", "20210526-41", "20210526-48", "20210526-65",
"20210526-58", "20210526-40", "20210526-5", "20210526-38", "20210526-55",
"20210526-60", "20210526-61", "20210526-2", "20210526-1", "20210526-63",
"20210526-37", "20210526-36", "20210526-35", "20210526-8", "20210526-19",
"20210526-18", "20210526-30", "20210526-27", "20210526-26", "20210526-24",
"20210526-25", "20210526-22", "20210526-47", "20210526-31", "20210526-39",
"20210526-54", "20210526-64", "20210526-53", "20210526-21", "20210526-42",
"20210526-20", "20210526-57", "20210526-50", "20210526-15", "20210526-3",
"20210526-23", "20210526-45", "20210526-6", "20210526-34", "20210526-7",
"20210526-17", "20210526-29", "20210526-28", "20210526-51", "20210526-49",
"20210536-2", "20210536-1", "20210521-NA", "20210521-NA", "20210521-NA",
"20210521-NA", "20210521-NA", "20210521-NA", "20210526-NA", "20210526-NA",
"20210526-NA", "20210526-NA", "20210526-NA", "20210526-NA", "20210526-NA",
"20210526-NA", "20210526-NA", "20210526-NA", "20210526-NA", "20210526-NA",
"20210526-NA", "20210526-NA", "20210526-NA", "20210526-NA", "20210526-NA",
"20210526-NA", "20210526-NA", "20210536-NA", "20210536-NA", "20210536-NA",
"20210536-NA", "20210536-NA", "20210536-NA", "20210536-NA", "20210536-NA",
"20210536-NA", "20210536-NA", "20210536-NA", "20210536-NA", "20210536-NA",
"20210536-NA", "20210536-NA", "20210536-NA", "20210536-NA", "20210536-NA",
"20210536-NA", "20210536-NA", "20210536-NA", "20210536-NA"),
Cross = c("NTBG X SDZ", "NTBG X SDZ", "NTBG X SDZ", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "CBG X CBG", "CBG X CBG",
"NTBG X SDZ", "NTBG X SDZ", "NTBG X SDZ", "NTBG X SDZ", "NTBG X SDZ",
"NTBG X SDZ", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"CBG X CBG", "CBG X CBG", "CBG X CBG", "CBG X CBG", "CBG X CBG",
"CBG X CBG", "CBG X CBG", "CBG X CBG", "CBG X CBG", "CBG X CBG",
"CBG X CBG", "CBG X CBG", "CBG X CBG", "CBG X CBG", "CBG X CBG",
"CBG X CBG", "CBG X CBG", "CBG X CBG", "CBG X CBG", "CBG X CBG",
"CBG X CBG", "CBG X CBG", "NTBG X SDZ", "NTBG X SDZ", "NTBG X SDZ",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "CBG X CBG",
"CBG X CBG", "NTBG X SDZ", "NTBG X SDZ", "NTBG X SDZ", "NTBG X SDZ",
"NTBG X SDZ", "NTBG X SDZ", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG", "SDZ X UCBG",
"SDZ X UCBG", "CBG X CBG", "CBG X CBG", "CBG X CBG", "CBG X CBG",
"CBG X CBG", "CBG X CBG", "CBG X CBG", "CBG X CBG", "CBG X CBG",
"CBG X CBG", "CBG X CBG", "CBG X CBG", "CBG X CBG", "CBG X CBG",
"CBG X CBG", "CBG X CBG", "CBG X CBG", "CBG X CBG", "CBG X CBG",
"CBG X CBG", "CBG X CBG", "CBG X CBG"), Rep = c("A", "B",
"C", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A",
"A", "A", "A", "B", "B", "B", "B", "B", "B", "B", "B", "B",
"B", "B", "B", "B", "B", "B", "C", "C", "C", "C", "C", "C",
"C", "C", "C", "C", "C", "C", "C", "C", "C", "C", "C", "C",
"D", "D", "D", "D", "D", "D", "D", "D", "D", "D", "D", "D",
"D", "D", "D", "D", "D", "A", "B", "A", "B", "B", "C", "D",
"D", "A", "A", "A", "A", "A", "B", "B", "B", "B", "B", "B",
"B", "B", "C", "C", "C", "D", "D", "D", "A", "A", "A", "A",
"A", "A", "B", "C", "C", "C", "C", "C", "D", "D", "D", "D",
"D", "D", "D", "D", "D", "D", "A", "B", "C", "A", "A", "A",
"A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "B",
"B", "B", "B", "B", "B", "B", "B", "B", "B", "B", "B", "B",
"B", "B", "C", "C", "C", "C", "C", "C", "C", "C", "C", "C",
"C", "C", "C", "C", "C", "C", "C", "C", "D", "D", "D", "D",
"D", "D", "D", "D", "D", "D", "D", "D", "D", "D", "D", "D",
"D", "A", "B", "A", "B", "B", "C", "D", "D", "A", "A", "A",
"A", "A", "B", "B", "B", "B", "B", "B", "B", "B", "C", "C",
"C", "D", "D", "D", "A", "A", "A", "A", "A", "A", "B", "C",
"C", "C", "C", "C", "D", "D", "D", "D", "D", "D", "D", "D",
"D", "D"), Garden = c("Limahuli", NA, NA, NA, NA, "Limahuli",
"Limahuli", "Limahuli", NA, NA, NA, "Limahuli", NA, "Limahuli",
NA, "Limahuli", "Limahuli", NA, NA, "Limahuli", NA, NA, NA,
NA, "Limahuli", "Limahuli", "Limahuli", "Limahuli", NA, "Limahuli",
NA, "Limahuli", "Limahuli", NA, "Limahuli", "Limahuli", "Limahuli",
NA, "Limahuli", NA, "Limahuli", "Limahuli", NA, NA, "Limahuli",
NA, NA, "Limahuli", NA, NA, NA, "Limahuli", "Limahuli", NA,
NA, "Limahuli", NA, "Limahuli", NA, "Limahuli", NA, NA, NA,
"Limahuli", NA, "Limahuli", "Limahuli", NA, "Limahuli", NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, "McBryde", "McBryde", "McBryde", "McBryde", NA, NA,
NA, "McBryde", "McBryde", "McBryde", NA, "McBryde", NA, "McBryde",
NA, NA, "McBryde", "McBryde", NA, "McBryde", "McBryde", "McBryde",
"McBryde", NA, NA, NA, NA, "McBryde", NA, "McBryde", NA,
NA, "McBryde", NA, NA, NA, "McBryde", NA, "McBryde", NA,
NA, "McBryde", "McBryde", NA, "McBryde", "McBryde", NA, NA,
"McBryde", "McBryde", NA, NA, "McBryde", "McBryde", NA, "McBryde",
NA, "McBryde", NA, "McBryde", "McBryde", "McBryde", NA, "McBryde",
NA, NA, "McBryde", NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA), Days1 = c(17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 16, 17, 16, 17, 17, 17, 17, 17, 17, 17,
16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 16, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 16, 17, 16, 17, 17, 17, 17, 17, 17, 17, 16, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 16), Days2 = c(59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 60, 60, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 60, 59, 59, 59, 59, 59, 59, 59, 60,
60, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 60, 60, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
59, 59, 60, 59, 59, 59, 59, 59, 59, 59, 60, 60, 59), Days3 = c(72,
79, 79, 79, 76, 79, 76, 79, 76, 79, 79, 76, 76, 76, 72, 72,
72, 79, 76, 79, 76, 79, 76, 76, 76, 76, 76, 76, 76, 76, 76,
72, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 72, 72,
72, 72, 72, 72, 76, 79, 76, 79, 79, 76, 79, 76, 79, 76, 76,
76, 76, 76, 76, 72, 72, 76, 72, 65, 79, 65, 76, 79, 79, 76,
76, 72, 72, 65, 79, 79, 76, 76, 76, 76, 76, 76, 72, 69, 62,
79, 76, 76, 76, 76, 76, 72, 72, 72, 72, 76, 72, 72, 72, 69,
76, 72, 72, 76, 76, 76, 76, 69, 69, 65, 72, 79, 79, 79, 76,
79, 76, 79, 76, 79, 79, 76, 76, 76, 72, 72, 72, 79, 76, 79,
76, 79, 76, 76, 76, 76, 76, 76, 76, 76, 76, 72, 76, 76, 76,
76, 76, 76, 76, 76, 76, 76, 76, 76, 72, 72, 72, 72, 72, 72,
76, 79, 76, 79, 79, 76, 79, 76, 79, 76, 76, 76, 76, 76, 76,
72, 72, 76, 72, 65, 79, 65, 76, 79, 79, 76, 76, 72, 72, 65,
79, 79, 76, 76, 76, 76, 76, 76, 72, 69, 62, 79, 76, 76, 76,
76, 76, 72, 72, 72, 72, 76, 72, 72, 72, 69, 76, 72, 72, 76,
76, 76, 76, 69, 69, 65), Check1.Survival = structure(c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 1L,
2L, 1L, 2L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 1L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 1L, 2L, 1L,
2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L), levels = c("alive", "dead"), class = "factor"),
Check2.Survival = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, NA, 2L, NA, NA, NA, NA, 1L, NA, 2L, NA, 2L, NA, 2L,
2L, NA, NA, 2L, 2L, NA, 2L, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, 1L, NA, NA, NA, NA, NA,
NA, NA, NA, NA, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, NA, 2L,
NA, NA, NA, NA, 1L, NA, 2L, NA, 2L, NA, 2L, 2L, NA, NA, 2L,
2L, NA, 2L, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, 1L, NA, NA, NA, NA, NA, NA, NA, NA, NA
), levels = c("alive", "dead"), class = "factor"), Check3.Survival = structure(c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, NA, NA, NA, NA, NA, NA, 2L,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
1L, NA, NA, NA, NA, NA, NA, NA, NA, NA, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, NA, NA, NA, NA, NA, NA, 2L, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 1L, NA, NA, NA,
NA, NA, NA, NA, NA, NA), levels = c("alive", "dead"), class = "factor")), row.names = c(NA,
-232L), class = c("tbl_df", "tbl", "data.frame"))
“DaysX”前缀与“CheckX”前缀配对。我只需要一个长的df(或tibble)与这些变量配对。
我试过了
test<-out %>%
pivot_longer(
cols = c(Days1:Days10, Check1.Survival:Check10.Survival),
names_to = c(".value", "rating"),
names_pattern = "([a-z]+)_*(.+)") %>%
rename(Days = ays, Survival = heck)
但变量不是成对的。我也试过了,
test2<-out%>%
pivot_longer(
c(-UID, -Cross, -Rep, -Garden),
names_to = c(".value", "item"),
names_sep = "_"
) %>%
select(-item)
但这似乎根本不能改变df。我知道我错过了一些超级简单的东西。
2条答案
按热度按时间5tmbdcev1#
下面是一个Liner:
解析正则表达式:
sycxhyv72#
我无法想象你想要的结果这是您的示例数据的预期结果吗?
创建于2023-03-31带有reprex v2.0.2