long.string {ComPairWise} | R Documentation |
Internal function in ComPairWise. Makes a string of "+", "-", and "o" describing which columns in the alignments were the same, different, or all gap/all missing.
long.string(col.ident)
col.ident |
Logical vector; output of |
Generates a single character string in which identical columns are represented with "+", different columns with "-", and all gap/all missing columns with "o". Designed to be copied/pasted into a text alignment.
A single string, as long as the reference alignment.
TER
x<-c(TRUE, FALSE, TRUE, TRUE, NA, FALSE) y<-long.string(x); y #should return "+-++o-" ## The function is currently defined as function (col.ident) { ident.string <- col.ident ident.string[which(col.ident)] <- "+" ident.string[which(!col.ident)] <- "-" ident.string[which(is.na(col.ident))] <- "o" id.s <- paste(ident.string, sep = "", collapse = "") return(id.s) }