Learn R Programming

polySegratio (version 0.2-6)

makeLabel: Generate labels from two columns where blanks in first column are replaced by preceding non--blank label

Description

Primarily used to generate marker labels from two columns where the first column is a nucleotide sequence which is mainly blank in that it is the same as the previous one while the second column is increasing numbers (fragment size) for each nucleotide combination

Usage

makeLabel(x, columns = c(1, 2), squash = TRUE, sep = "")

Value

returns vector of marker names

Arguments

x

data frame of markers including labels

columns

the column numbers containing labels (default: c(1,2))

squash

remove trailing/leading blanks in 1st column (default:TRUE)

sep

separator when combining two label columns (default: "")

Author

Peter Baker drpetebaker@gmail.com

See Also

autoFill is used to replace blanks in first column

Examples

Run this code

  ## imaginary data frame representing ceq marker names read in from
  ## spreadsheet
  x <- data.frame( col1 = c("agc","","","","gct5","","ccc","",""),
                   col2 = c(1,3,4,5,1,2,2,4,6))
  print(x)
  print(makeLabel(x))
  print(cbind(x,lab=makeLabel(x, sep=".")))

Run the code above in your browser using DataLab