I've successfully rearranged the dataset into the format I want (see code annotation). However:
(a) I feel that there's a cleaner more efficient way to construct the database, maybe in the Tidyverse? My solution reads as a bit hacked together, and it takes a lot of code to implement. I'd really like to find an elegant and efficient way to do this, but need help.
(b) I am having trouble with the NA values. No matter what I do, R reads them as characters. I don't know if this is crucial for analysis as when I pass the as.numeric() function, it coerces these to NA values anyways. However, I'd like to understand what I'm doing wrong, and how to 'do it right' going forward.
I've provided the code I'm using below, annotated, and dput() 5 lines from my (very large) data set are at the end of the code block to help re-create. Any help/feedback would be much appreciated. Thank you.
library(tidyverse)
# Load data set. This is how I'm loading the data. While the dput() output is at the
# bottom of the code block, I've included this so people can see my steps for input, and
# how I'm inputting NA's.
pheno_sep_imp <- read.table(file="~/pheno_sep_imp.txt",
row.names = 1, header = TRUE,
na.strings = c(NA, "NA", " NA"), sep ="\t")
pheno_sep_imp <- data.frame(pheno_sep_imp,stringsAsFactors = T)
pheno_sep_imp <- mutate_if(pheno_sep_imp, is.integer, as.factor)
pheno_sep_imp <- mutate_if(pheno_sep_imp, is.character, as.factor)
# Remove anterior teeth
pheno_sep_imp <- pheno_sep_imp[c(1:6,22:46,62:86)]
# Re-code R3En to 3 for analysis
pheno_sep_imp[pheno_sep_imp == "R3En"] <- 3
# Re-code CON to NA for analysis. This is the point where NA's become a problem as they're # converting to 'character'.
pheno_sep_imp[pheno_sep_imp == "CON"] <- NA
# Create an empty data frame for transformed data set
dta <- data.frame(matrix(vector(), 0, 8,
dimnames = list(c(),
c("Ind", "Geo",
"E1", "E2", "E3", "E4", "E5",
"Tooth"))),
stringsAsFactors=FALSE)
# Select names of columns from original data set for teeth/elements
nms <- names(pheno_sep_imp)
str_nms <- strsplit(nms, "_")
tooth_names <- NULL
for(i in 1:length(str_nms)){
if(i>1){
tooth_names <- c(tooth_names, paste0(str_nms[[i]][1]))
}
}
# variable locations in pheno_sep_imp, put into dta
root_num <- seq(7, 52, by=5)
count = 0
for(i in 1:dim(pheno_sep_imp)[1]){
tmp <- pheno_sep_imp[i,]
ind <- paste0("ind_",i)
for(k in root_num){
count <- count + 1
dta[count,] <- c(ind,toString(tmp[2][1,1]),
toString(tmp[k][[1]]),
toString(tmp[k+1][[1]]),
toString((tmp[k+2][[1]])),
toString((tmp[k+3][[1]])),
toString((tmp[k+4][[1]])),
tooth_names[k-1])
}
}
# check structure of data set
str(dta)
# check to see if NA's are NA's or 'characters'
class(dta$E1[1])
dta$E1 <- as.numeric(dta$E1) # Warning message: NAs introduced by coercion
dta$E2 <- as.numeric(dta$E2) # Warning message: NAs introduced by coercion
dta$E3 <- as.factor(dta$E3) # works as it should
dta$E4 <- as.factor(dta$E4) # works as it should
dta$E5 <- as.factor(dta$E5) # works as it should
dta$Geo <- as.factor(dta$Geo) # works as it should
dta$Ind <- as.factor(dta$Ind) # works as it should
dta <- dta[complete.cases(dta),]
View(dta) # Data is in the format I want/need for my analysis.
# dput() of 5 lines from my data set:
structure(list(Sex = structure(c(2L, 2L, 2L, 1L, NA, 1L), .Label = c("Female",
"Male"), class = "factor"), G1_Major_Human_Subdivisions = structure(c(2L,
2L, 2L, 2L, 2L, 2L), .Label = c("Sahul_Pacific", "Sino_Americas",
"Sub_Saharan_Africa", "Sunda_Pacific", "West_Eurasia"), class = "factor"),
G2_Continental_Group = structure(c(4L, 4L, 4L, 4L, 4L, 4L
), .Label = c("Central_America", "Europe", "North_Africa",
"North_America", "Oceania", "South_America", "South_Asia",
"South_East_Asia", "Sub_Saharan_Africa"), class = "factor"),
G3_Continental_Region = structure(c(1L, 1L, 1L, 1L, 1L, 1L
), .Label = c("American_Arctic", "Andaman_Archipelago", "Andean",
"Australia", "Carribbean", "Central_Africa", "Central_America",
"Central_Europe", "Eastern_Africa", "Eastern_Europe", "Indian_Sub_Continent",
"Indochinese_Peninsula", "Malay_Archipelago", "Melanesia",
"NA_Northeast_Woodlands", "NA_Northwest_Coast", "NA_Plains",
"NA_South_West", "NA_Subarctic", "NA_Unknown", "North_East_Africa",
"North_Western_Africa", "Northern_Africa", "Northern_Europe",
"Polynesia", "SA_Unknown", "Southern_Africa", "Southern_Europe",
"SSA_Unknown", "Western_Africa", "Western_Europe"), class = "factor"),
G4_Country_State = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = c("Alaska",
"American_Arctic_Unknown", "Andaman_Island", "Angola", "Argentina",
"Australia_Unknown", "Austrian", "Bangladesh", "Barbados",
"Canada", "Canary_Islands", "Central_Australia", "Chile",
"Congo", "Czechoslovakia", "East_India", "Egypt", "England",
"Finland", "France", "Germany", "Ghana", "Greece", "Greenland",
"Guatemala", "Guinea", "Hungary", "India", "India_Unknown",
"Indonesia", "Italy", "Jamaica", "Kenya", "Malta", "Mozambique",
"Myanmar", "NA_Unknown", "Namibia", "New_South_Wales", "New_Zealand",
"Nicobar_Island", "Nigeria", "North_India", "Northern_Territory",
"Pakistan", "Papua_New_Guinea", "Peru", "Philippines", "Queensland",
"Russia", "SA_Unknown", "Solomon_Islands", "Somalia", "South_Africa",
"South_Australia", "South_East_Australia", "South_India",
"Spain", "Sri_Lanka", "SSA_Unknown", "Sudan", "Sweden", "Switzerland",
"Tanzania", "Uganda", "Ukraine", "United_States", "Victoria",
"West_India", "Western_Australia", "Zimbabwe"), class = "factor"),
G5_Locality_Tribe = structure(c(57L, 57L, 57L, 57L, 57L,
57L), .Label = c("Aborigine", "Aboringine", "Ainaho", "Ainaho_Burao",
"Akamba", "Ali_Kush", "Amaponda", "Amaxhosa_Great_Winterberg",
"Apache", "Arawak", "Ashanti", "Badari", "Baffin_Island",
"Baiono", "Ballam_Coffa", "Bambuti_Pygmy", "Bantu_Kaoisoudo",
"Basuto", "Bechuanaland", "Bengal", "Bengal_Bangladesh",
"Berida", "Bihari", "Bingemma", "Brazaville", "Brittany",
"Bukoba", "Cape_Spencer_Aborigine", "Colombo", "Coorg", "Crime_Sebastopol",
"Crocodile _Island_Yan_nhanu", "Croydon_Queensland", "Darood",
"Darood_Hawiya", "Deccan_Berars", "Derby_Coast_Aborigine",
"Didali", "Dravidian", "Eingenadu", "Fanti", "Gannawarri",
"Gondaiaio", "Graubunden_Saint_Moritz", "Guanche", "Hadad",
"Halle", "Hariya", "Haya", "Hexham", "Hindu", "Hindustan",
"Hindustan_Bihar", "Huron", "Inuit", "Inuit_Eleanoran_Bay",
"Ipiutak", "Iroquois", "Java", "Jebel_Moya", "Jilili", "Kaduna",
"Kagoro", "Kalahari", "Kerma", "Ketchipawan", "Khanty_Kondinski",
"Khoikhoi", "Kikuyu", "Knysna_Cave", "Korana", "Kwaiawata _Island_Muyuw",
"Lapland", "Lazio", "Loddon_River_Aborigine", "Luanda", "Mackay_Aborigine",
"Makah", "Makua", "Malaysian", "Manatee_Cradock", "Manitoba",
"Maori", "Mem_Mem", "Minorca", "Mortlake_Aborigine", "Mumbai_Parsi",
"Muri_Province", "Murray_River", "Murray_River_Aborigine",
"Murua_Island_Muyuw", "Muyuw_Kwaiawata_Island", "Nagada",
"Naharhmpikya_Sinhalese", "Native_American", "New_Britain",
"New_Westminster", "Newcastle", "North_Queensland ", "Oriomo_River_Daudai",
"Paestum", "Pagi_Island", "Pakistan", "Paliyan_Tribe", "Paris",
"Pasamayo", "Pathan", "Patna", "Perth", "Plympton_Aborigine",
"Port_Elizabeth", "Punjab", "Rio_Gallegos", "Rome", "Salekhard",
"Sardinia", "Sicily", "Sioux", "South_Wilshire", "St_Bernard",
"Swanport_Aborigine", "Tagalog_Island", "Tal_Horr", "Tegera_Well",
"Teita", "Teso", "Thessaly", "Tigara", "Toszeg", "Upper_Congo_River",
"Valparaiso", "Vancouver_Island", "Veddah", "Vienna", "Walvis_Bay",
"Wollongong", "Wynberg_San", "Yola", "Yoruba_Ilorin", "Zuni"
), class = "factor"), RI1_MAX_E1 = structure(c(1L, 1L, 1L,
1L, 1L, 1L), .Label = "1", class = "factor"), RI1_MAX_E2 = structure(c(1L,
1L, 1L, 1L, 1L, 1L), .Label = "1", class = "factor"), RI1_MAX_E3 = structure(c(1L,
1L, 1L, 1L, 1L, 1L), .Label = "A", class = "factor"), RI1_MAX_E4 = structure(c(2L,
2L, 2L, 2L, 2L, 2L), .Label = c("E", "G", "P", "W"), class = "factor"),
RI1_MAX_E5 = structure(c(2L, 2L, 2L, 2L, 2L, 2L), .Label = c("O",
"R"), class = "factor"), RI2_MAX_E1 = structure(c(1L, 1L,
1L, 1L, 1L, 1L), .Label = c("1", "CON"), class = "factor"),
RI2_MAX_E2 = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = c("1",
"2", "CON"), class = "factor"), RI2_MAX_E3 = structure(c(1L,
1L, 1L, 1L, 1L, 1L), .Label = c("A", "B1L1", "CON"), class = "factor"),
RI2_MAX_E4 = structure(c(3L, 2L, 3L, 3L, 2L, 3L), .Label = c("CON",
"E", "G", "P", "W"), class = "factor"), RI2_MAX_E5 = structure(c(3L,
3L, 3L, 3L, 3L, 3L), .Label = c("CON", "O", "R", "R4"), class = "factor"),
RC1_MAX_E1 = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = "1", class = "factor"),
RC1_MAX_E2 = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = c("1",
"2"), class = "factor"), RC1_MAX_E3 = structure(c(1L, 1L,
1L, 1L, 1L, 1L), .Label = c("A", "B1L1"), class = "factor"),
RC1_MAX_E4 = structure(c(4L, 1L, 1L, 5L, 5L, 5L), .Label = c("E",
"EBi", "G", "P", "W"), class = "factor"), RC1_MAX_E5 = structure(c(1L,
1L, 2L, 1L, 1L, 1L), .Label = c("O", "R", "R5"), class = "factor"),
RP3_MAX_E1 = structure(c(2L, 1L, 1L, 1L, 1L, 1L), .Label = c("1",
"2", "3"), class = "factor"), RP3_MAX_E2 = structure(c(2L,
2L, 1L, 1L, 2L, 2L), .Label = c("1", "2", "3"), class = "factor"),
RP3_MAX_E3 = structure(c(2L, 2L, 1L, 1L, 2L, 2L), .Label = c("A",
"B1L1", "B1L2", "B2L1", "M1D1", "M1D1L1"), class = "factor"),
RP3_MAX_E4 = structure(c(1L, 17L, 17L, 17L, 17L, 18L), .Label = c("BGLG",
"BGLKBi", "BHLE", "BHLG", "BKLG", "BPLG", "BWLG", "E", "H",
"HBi", "K", "KBi", "MEDGLG", "MGDGLE", "MGDGLG", "MPDPLE",
"P", "PBi", "W"), class = "factor"), RP3_MAX_E5 = structure(c(3L,
11L, 8L, 8L, 3L, 10L), .Label = c("BR2LR", "BR4LR", "BRLR",
"BRLR2", "i2", "i5", "MRDRLR", "O", "R", "R2", "R4", "R5"
), class = "factor"), RP4_MAX_E1 = structure(c(1L, 1L, 1L,
1L, 1L, 1L), .Label = c("1", "2", "3"), class = "factor"),
RP4_MAX_E2 = structure(c(2L, 1L, 1L, 1L, 1L, 1L), .Label = c("1",
"2", "3", "4"), class = "factor"), RP4_MAX_E3 = structure(c(2L,
1L, 1L, 1L, 1L, 1L), .Label = c("A", "B1L1", "B2L1", "B2L2",
"M1D1L1"), class = "factor"), RP4_MAX_E4 = structure(c(13L,
13L, 13L, 13L, 13L, 13L), .Label = c("BELG", "BGLG", "BHLG",
"BKLG", "E", "G", "H", "HBi", "K", "KBi", "MGDGLE", "MLFBiDG",
"P", "PBi", "W"), class = "factor"), RP4_MAX_E5 = structure(c(10L,
7L, 7L, 7L, 7L, 7L), .Label = c("BR2L4", "BR2LR", "BRLR",
"i2", "i5", "MRDRLR", "O", "R", "R2", "R4", "R5"), class = "factor"),
RM1_MAX_E1 = structure(c(3L, 3L, 3L, 3L, 3L, 2L), .Label = c("1",
"2", "3", "4"), class = "factor"), RM1_MAX_E2 = structure(c(3L,
2L, 2L, 2L, 2L, 2L), .Label = c("2", "3", "4", "5", "6"), class = "factor"),
RM1_MAX_E3 = structure(c(9L, 3L, 3L, 3L, 3L, 3L), .Label = c("B1L1",
"M1D1", "M1D1L1", "M1D1L2", "M1D2", "M1D2L1", "M1L1", "M2D1",
"M2D1L1", "M2D1L2", "M2D2L1", "M2D2L2", "M3D1L1", "MB1DB1ML1DL1"
), class = "factor"), RM1_MAX_E4 = structure(c(51L, 32L,
32L, 45L, 32L, 38L), .Label = c("BKLG", "BPLG", "MBPDBEMLEDLG",
"MDFLE", "MDFLG", "MDFLK", "MDFLP", "MEDELE", "MEDELP", "MEDGLG",
"MEDKLE", "MEDPLE", "MEDWLK", "MHDELP", "MHDPLE", "MHDPLP",
"MKDELE", "MKDELP", "MKDGLE", "MKDGLG", "MKDGLP", "MKDPLE",
"MKDPLG", "MKDPLP", "MLFBiDG", "MLFBiDP", "MLFDE", "MPBiDPLG",
"MPBiDPLK", "MPBiDPLP", "MPDELE", "MPDELG", "MPDELK", "MPDELP",
"MPDGLE", "MPDGLG", "MPDGLP", "MPDLF", "MPDLFBi", "MPDP",
"MPDPLE", "MPDPLG", "MPDPLK", "MPDPLP", "MPDWLE", "MPDWLG",
"MPDWLP", "MWBiDPLP", "MWBiDWLG", "MWDE", "MWDELE", "MWDELG",
"MWDELK", "MWDELP", "MWDGLE", "MWDGLG", "MWDGLK", "MWDGLP",
"MWDGLR", "MWDGLW", "MWDKLE", "MWDKLG", "MWDKLP", "MWDLF",
"MWDLFBi", "MWDPDE", "MWDPLE", "MWDPLG", "MWDPLK", "MWDPLP",
"MWDPLW", "MWDWLE", "MWDWLG", "MWDWLK", "MWDWLP", "P"), class = "factor"),
RM1_MAX_E5 = structure(c(29L, 42L, 22L, 22L, 20L, 22L), .Label = c("BOLR",
"MBODBOMLRDLR", "Mi2DOLO", "Mi2DOLR", "Mi2DR4LR4", "Mi2DRLO",
"Mi2DRLR", "Mi2DRLR2", "Mi3DOLR", "Mi3DRLO", "Mi3DRLR", "Mi4DRLR",
"Mi5DOLO", "Mi5DOLR", "Mi5DRLO", "Mi5DRLR", "MODi2", "MODLi5",
"MODOLO", "MODOLR", "MODRLO", "MODRLR", "MODRLR2", "MR2DO",
"MR2DOLO", "MR2DOLR", "MR2DR2LO", "MR2DRLO", "MR2DRLR", "MR2DRLR2",
"MR4DOLO", "MR4DOLR", "MR4DRLO", "MR4DRLR", "MR5DOLO", "MR5DRLO",
"MR5DRLR", "MRDOLO", "MRDOLR", "MRDRLi5", "MRDRLO", "MRDRLR",
"R2"), class = "factor"), RM2_MAX_E1 = structure(c(1L, 1L,
1L, 1L, 3L, 3L), .Label = c("1", "2", "3", "4"), class = "factor"),
RM2_MAX_E2 = structure(c(3L, 3L, 3L, 3L, 3L, 3L), .Label = c("1",
"2", "3", "4"), class = "factor"), RM2_MAX_E3 = structure(c(5L,
5L, 5L, 5L, 5L, 5L), .Label = c("A", "B1L1", "M1B1D1L1",
"M1D1", "M1D1L1", "M1D2L1", "M2D1L1", "MB1DB1ML1DL1", "ML3D1"
), class = "factor"), RM2_MAX_E4 = structure(c(45L, 13L,
13L, 51L, 57L, 70L), .Label = c("BGLG", "BHLG", "BKLG", "BKLK",
"BKLP", "BLF", "BPLG", "H", "HBi", "KBi", "MBEDBEMLEDLE",
"MBWDBGMLEDLE", "MDFDLF", "MDFLE", "MDFLG", "MDFMLF", "MDFMLFBi",
"MEDELE", "MEDELG", "MEDGLE", "MEDGLG", "MEDGLK", "MEDKLG",
"MEDWLG", "MGDGLG", "MHBiDELE", "MHDELE", "MHDELG", "MHDELP",
"MHDGLG", "MHDGLP", "MHDWLP", "MKDELE", "MKDELG", "MKDELP",
"MKDGLE", "MKDGLG", "MKDGLP", "MKDLF", "MKDPLE", "MKDPLP",
"MLFBGDLF", "MLFBiDE", "MLFBiDG", "MLFBiDLF", "MLFBiDP",
"MLFBiDW", "MLFBiMDF", "MLFDE", "MLFDG", "MLFDLF", "MLFDLFBi",
"MLFDP", "MLFDW", "MLFMDF", "MPDELE", "MPDELG", "MPDELK",
"MPDELP", "MPDGLE", "MPDGLG", "MPDGLP", "MPDKLG", "MPDLF",
"MPDPLE", "MPDPLG", "MPDPLP", "MPDWLG", "MWDELE", "MWDELG",
"MWDELK", "MWDELP", "MWDGLE", "MWDGLG", "MWDGLK", "MWDGLP",
"MWDKLE", "MWDKLG", "MWDLF", "MWDLFBi", "MWDPLE", "MWDPLG",
"MWDPLK", "MWDPLP", "MWDWLE", "MWDWLG", "MWDWLP", "P", "W"
), class = "factor"), RM2_MAX_E5 = structure(c(28L, 16L,
20L, 16L, 25L, 44L), .Label = c("BOLO", "BOLR", "BRLR", "i2",
"i3", "MBRDBRMLRDLR", "MDi2LO", "MDi2LR", "Mi2DOLR", "Mi2DRLO",
"Mi2DRLR", "Mi3DRLO", "Mi5DOLR", "Mi5DRLR", "MLi2DO", "MLi2DR",
"MLi3DR", "MLi4DO", "MLi5DO", "MLi5DR", "MLODLi2", "MODi5LR",
"MODLi2", "MODOLO", "MODOLR", "MODR4LR", "MODRLO", "MODRLR",
"MR2DOLO", "MR2DOLR", "MR2DRLO", "MR2DRLR", "MR4DOLO", "MR4DOLR",
"MR4DRLO", "MR4DRLR", "MR5DRLO", "MR5DRLR", "MRBRDRLR", "MRDLi2",
"MRDOLO", "MRDOLR", "MRDRLO", "MRDRLR", "O", "R", "R2"), class = "factor"),
RM3_MAX_E1 = structure(c(3L, 1L, 3L, 1L, 2L, 1L), .Label = c("1",
"2", "3", "4", "CON"), class = "factor"), RM3_MAX_E2 = structure(c(3L,
3L, 3L, 3L, 3L, 3L), .Label = c("1", "2", "3", "4", "CON"
), class = "factor"), RM3_MAX_E3 = structure(c(7L, 7L, 7L,
7L, 7L, 7L), .Label = c("A", "B1L1", "B2D1L1", "CON", "M1B1D1L1",
"M1D1", "M1D1L1", "M1D1L2", "M1D2", "M1D2L1", "M2D1", "M2D1L1",
"M2D2", "MB1DB1ML1DL1", "ML3D1"), class = "factor"), RM3_MAX_E4 = structure(c(70L,
49L, 70L, 49L, 61L, 49L), .Label = c("BGLG", "BGLK", "BKDGLG",
"BKLG", "CON", "E", "G", "HBi", "K", "MBEDBGMLEDLG", "MBEDBGMLGDLG",
"MBGDBGMLGDLG", "MDF", "MDFDLF", "MDFLE", "MDFLG", "MEDELE",
"MEDELP", "MEDGLE", "MEDGLG", "MEDLF", "MEDP", "MEDWLE",
"MGDELG", "MGDGLG", "MGDLF", "MHBiDELG", "MHBiDH", "MHBiDHBi",
"MHDGLE", "MHDGLG", "MHDH", "MHDK", "Mi", "MKDELE", "MKDELG",
"MKDGLE", "MKDGLG", "MKDGLP", "MKDKLG", "MKDLF", "MKDP",
"MKDPLG", "MLFBiDE", "MLFBiDG", "MLFBiDLF", "MLFDE", "MLFDG",
"MLFDLF", "MLFDP", "MLFMDF", "MPBiDGLG", "MPBiDW", "MPDELE",
"MPDELG", "MPDGLE", "MPDGLG", "MPDGLP", "MPDGLPBi", "MPDH",
"MPDLF", "MPDP", "MPDPBi", "MPDPLG", "MWBEDELG", "MWDELE",
"MWDELG", "MWDELP", "MWDGLE", "MWDGLG", "MWDGLP", "MWDH",
"MWDKLG", "MWDLF", "MWDPLG", "MWDW", "MWDWLG", "P"), class = "factor"),
RM3_MAX_E5 = structure(c(45L, 45L, 45L, 17L, 29L, 45L), .Label = c("BOLR",
"BR2DRLR", "BRLO", "BRLR", "CON", "i2", "i3", "i5", "MBRBDRMLRDLR",
"MBRDBRMLRDLR", "MDi2LR", "Mi2DOLR", "Mi2DR", "Mi2DRLR",
"Mi3DRLR", "Mi5DRLR", "MLi2DR", "MLi4DR", "MODi5LR", "MODLi2",
"MODLi3", "MODLi5", "MODO", "MODOLO", "MODOLR", "MODR", "MODR4",
"MODRLO", "MODRLR", "MODRLR2", "MR2DOLO", "MR2DR2", "MR2DRLO",
"MR2DRLR", "MR4DR2", "MR4DR4", "MR4DRLO", "MR4DRLR", "MRBRDRLR",
"MRDLi5", "MRDOLR", "MRDR", "MRDR2", "MRDRLO", "MRDRLR",
"O", "R", "R2", "R4"), class = "factor"), ri1_mand_E1 = structure(c(1L,
1L, 1L, 1L, 1L, 1L), .Label = "1", class = "factor"), ri1_mand_E2 = structure(c(1L,
1L, 1L, 1L, 1L, 1L), .Label = c("1", "2"), class = "factor"),
ri1_mand_E3 = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = c("A",
"B1L1"), class = "factor"), ri1_mand_E4 = structure(c(4L,
4L, 4L, 4L, 4L, 4L), .Label = c("E", "G", "K", "P", "W"), class = "factor"),
ri1_mand_E5 = structure(c(3L, 3L, 2L, 2L, 2L, 2L), .Label = c("i2",
"O", "R", "R2", "R4"), class = "factor"), ri2_mand_E1 = structure(c(1L,
1L, 1L, 1L, 1L, 1L), .Label = c("1", "CON"), class = "factor"),
ri2_mand_E2 = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = c("1",
"2", "CON"), class = "factor"), ri2_mand_E3 = structure(c(1L,
1L, 1L, 1L, 1L, 1L), .Label = c("A", "B1L1", "CON"), class = "factor"),
ri2_mand_E4 = structure(c(5L, 5L, 5L, 5L, 5L, 5L), .Label = c("CON",
"E", "H", "K", "P", "W"), class = "factor"), ri2_mand_E5 = structure(c(5L,
5L, 4L, 4L, 4L, 4L), .Label = c("CON", "i2", "i5", "O", "R",
"R2", "R4"), class = "factor"), rc1_mand_E1 = structure(c(1L,
1L, 1L, 1L, 1L, 1L), .Label = c("1", "2"), class = "factor"),
rc1_mand_E2 = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = c("1",
"2"), class = "factor"), rc1_mand_E3 = structure(c(1L, 1L,
1L, 1L, 1L, 1L), .Label = c("A", "B1L1"), class = "factor"),
rc1_mand_E4 = structure(c(2L, 6L, 2L, 7L, 6L, 7L), .Label = c("BGLG",
"E", "G", "H", "K", "P", "W", "WBi"), class = "factor"),
rc1_mand_E5 = structure(c(3L, 3L, 3L, 3L, 3L, 3L), .Label = c("BRLR",
"i2", "O", "R", "R2", "R4", "R5"), class = "factor"), rp3_mand_E1 = structure(c(1L,
1L, 1L, 1L, 1L, 1L), .Label = c("1", "2"), class = "factor"),
rp3_mand_E2 = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = c("1",
"2", "3"), class = "factor"), rp3_mand_E3 = structure(c(1L,
1L, 1L, 1L, 1L, 1L), .Label = c("A", "B1L1", "M1D1L1"), class = "factor"),
rp3_mand_E4 = structure(c(7L, 7L, 3L, 10L, 7L, 7L), .Label = c("BGLG",
"BWLG", "E", "G", "H", "K", "P", "T", "TBi", "W"), class = "factor"),
rp3_mand_E5 = structure(c(7L, 8L, 7L, 7L, 7L, 7L), .Label = c("BRLR",
"i2", "i3", "i4", "i5", "MRDRLR", "O", "R", "R2", "R4"), class = "factor"),
rp4_mand_E1 = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = "1", class = "factor"),
rp4_mand_E2 = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = c("1",
"2"), class = "factor"), rp4_mand_E3 = structure(c(1L, 1L,
1L, 1L, 1L, 1L), .Label = c("A", "B1L1"), class = "factor"),
rp4_mand_E4 = structure(c(5L, 1L, 2L, 5L, 5L, 5L), .Label = c("E",
"G", "HBi", "K", "P", "T", "TBi", "W"), class = "factor"),
rp4_mand_E5 = structure(c(2L, 3L, 3L, 2L, 2L, 2L), .Label = c("i5",
"O", "R", "R2", "R4"), class = "factor"), rm1_mand_E1 = structure(c(1L,
2L, 2L, 2L, 1L, 1L), .Label = c("2", "R3En"), class = "factor"),
rm1_mand_E2 = structure(c(2L, 2L, 2L, 2L, 3L, 3L), .Label = c("2",
"3", "4", "5", "6"), class = "factor"), rm1_mand_E3 = structure(c(3L,
2L, 2L, 2L, 3L, 5L), .Label = c("M1D1", "M1D1L1", "M2D1",
"M2D1L1", "M2D2", "M2D2L1", "M2D3", "M3D1", "M3D2", "M3D3"
), class = "factor"), rm1_mand_E4 = structure(c(17L, 36L,
36L, 45L, 40L, 40L), .Label = c("MHBiDELG", "MHBiDH", "MHBiDHBi",
"MHBiDK", "MHBiDKBi", "MHBiDP", "MHBiDPBi", "MHBiDPLE", "MHBiDPLG",
"MHBiDWLG", "MHDE", "MHDELG", "MHDG", "MHDGLG", "MHDH", "MHDK",
"MHDP", "MHDPBi", "MHDPLE", "MHDPLG", "MHDWLG", "MKBiDK",
"MKBiDP", "MKDH", "MKDK", "MKDP", "MPBiDELG", "MPBiDK", "MPBiDKLG",
"MPBiDP", "MPBiDPLE", "MPBiDPLG", "MPDE", "MPDELE", "MPDELG",
"MPDGLG", "MPDK", "MPDKBi", "MPDKLG", "MPDP", "MPDPBi", "MPDPLE",
"MPDPLG", "MPDPLP", "MPDPLW", "MPDWLG", "MPDWLW"), class = "factor"),
rm1_mand_E5 = structure(c(34L, 28L, 28L, 28L, 34L, 39L), .Label = c("Mi2Di2",
"Mi2Di3", "Mi2Di5", "Mi2DO", "Mi2DOLR", "Mi2DR", "Mi2DR2",
"Mi2DRLR", "Mi3Di2", "Mi3Di4", "Mi3DO", "Mi3DOLO", "Mi3DOLR",
"Mi3DRLR", "Mi4Di2", "Mi4Di4", "Mi4DO", "Mi4DR4", "Mi5Di2",
"Mi5Di5", "Mi5DO", "Mi5DOLR", "Mi5DR2", "Mi5DR4", "Mi5DRLR",
"MODO", "MODR", "MODRLR", "MR2Di2", "MR2Di2LR", "MR2Di3",
"MR2Di4", "MR2Di5", "MR2DO", "MR2DOLO", "MR2DOLR", "MR2DR",
"MR2DR2", "MR2DR4", "MR2DR5", "MR2DRLR", "MR4Di2", "MR4Di2LR",
"MR4Di3", "MR4Di4", "MR4DO", "MR4DOLR", "MR4DR", "MR4DR4",
"MR4DRLO", "MR4DRLR", "MR5DOLR", "MR5DR4", "MR5DRLO", "MRDO",
"MRDOLR", "MRDR"), class = "factor"), rm2_mand_E1 = structure(c(1L,
2L, 2L, 1L, 2L, 2L), .Label = c("1", "2", "3", "R3En"), class = "factor"),
rm2_mand_E2 = structure(c(2L, 2L, 2L, 2L, 3L, 3L), .Label = c("1",
"2", "3", "4"), class = "factor"), rm2_mand_E3 = structure(c(6L,
6L, 6L, 6L, 9L, 9L), .Label = c("A", "B1D1L1", "B2L1", "B2L2",
"M1B1D1", "M1D1", "M1D1L1", "M1D2", "M2D1", "M2D1L1", "M2D2",
"M3D1"), class = "factor"), rm2_mand_E4 = structure(c(5L,
39L, 30L, 5L, 21L, 39L), .Label = c("BGDPLG", "BHBiLP", "BPLK",
"BPLP", "Cs", "CsBi", "G", "MDF", "MEDE", "MGDPLW", "MHBiDE",
"MHBiDH", "MHBiDK", "MHBiDP", "MHBiDPBi", "MHDE", "MHDELP",
"MHDG", "MHDH", "MHDHBi", "MHDK", "MHDP", "MHDPLG", "MKBiDK",
"MKBiDP", "MKDE", "MKDG", "MKDH", "MKDHBi", "MKDK", "MKDP",
"MKDPBi", "MPBiDGLG", "MPBiDP", "MPDE", "MPDG", "MPDH", "MPDK",
"MPDP", "MPDPLG"), class = "factor"), rm2_mand_E5 = structure(c(5L,
17L, 18L, 7L, 21L, 21L), .Label = c("Bi5Li2", "BR2LO", "BRDOLR",
"i2", "i3", "i4", "i5", "Mi2Di2", "Mi2DO", "Mi2DR", "Mi2DR2",
"Mi3DO", "Mi3DR", "Mi4DO", "Mi5DO", "Mi5DR", "MODO", "MODR",
"MR2Di2", "MR2Di3", "MR2DO", "MR2DOLR", "MR2DR", "MR2DR2",
"MR2DR4", "MR2DRLR", "MR4Di2", "MR4DO", "MR4DOLR", "MR4DR",
"MR4DR4", "MR4DRLR", "MR5DO", "MRDO", "MRDOLR", "MRDR", "R",
"R2"), class = "factor"), rm3_mand_E1 = structure(c(1L, 1L,
1L, 2L, 2L, 2L), .Label = c("1", "2", "CON", "R3En", "R3Pa"
), class = "factor"), rm3_mand_E2 = structure(c(2L, 1L, 1L,
2L, 3L, 3L), .Label = c("1", "2", "3", "4", "CON"), class = "factor"),
rm3_mand_E3 = structure(c(6L, 1L, 1L, 6L, 9L, 9L), .Label = c("A",
"B2L1", "CON", "M1B1D1", "M1B2D1", "M1D1", "M1D1L1", "M2B1D1",
"M2D1", "M2D1L1", "M2D2", "M3D1"), class = "factor"), rm3_mand_E4 = structure(c(3L,
25L, 25L, 44L, 32L, 47L), .Label = c("BHLP", "CON", "Cs",
"E", "G", "K", "MCsLG", "MDF", "MDFLG", "MEDELG", "MEDG",
"MELE", "MGBGDE", "MGBPDK", "MGDK", "MHBiDK", "MHBiDP", "MHDE",
"MHDELG", "MHDG", "MHDGLG", "MHDK", "MHDP", "MHDPLG", "Mi",
"MKBGDG", "MKBiDK", "MKBiDP", "MKDE", "MKDG", "MKDGLG", "MKDK",
"MKDP", "MKDPLG", "MKDW", "MPBGDE", "MPBGDG", "MPBGDP", "MPBiDE",
"MPBiDK", "MPBPDE", "MPDE", "MPDELG", "MPDG", "MPDGLG", "MPDK",
"MPDP", "MPDPLE", "MPDPLG", "MPDWLG", "MWDELG", "MWDP", "P"
), class = "factor"), rm3_mand_E5 = structure(c(3L, 42L,
42L, 23L, 33L, 26L), .Label = c("BR2LO", "CON", "i2", "i3",
"i5", "Mi2BRDR", "Mi2Di2", "Mi2DO", "Mi2DOLR", "Mi2DR", "Mi2DRLR",
"Mi3DO", "Mi3DOLR", "Mi3LR", "Mi4DR", "Mi5DO", "Mi5DR", "Mi5DRLR",
"MOBRDO", "MOBRDR", "MODO", "MODOLR", "MODR", "MODRLR", "MR2BRDR",
"MR2DO", "MR2DOLR", "MR2DR", "MR2DR2", "MR2DR4", "MR2DRLR",
"MR4Di5", "MR4DO", "MR4DR", "MR4DR4", "MR4DRLR", "MRBR2DO",
"MRBRDR", "MRDR", "MRDRLR", "O", "R", "R2"), class = "factor")), row.names = c("99_1_192",
"99_1_194", "99_1_196", "99_1_197", "99_1_198", "99_1_201"), class = "data.frame")