long.string {ComPairWise}R Documentation

Make the +-o string

Description

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.

Usage

long.string(col.ident)

Arguments

col.ident Logical vector; output of comp.mat

Details

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.

Value

A single string, as long as the reference alignment.

Author(s)

TER

Examples


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)
  }

[Package ComPairWise version 1.01 Index]