autoFill: Automatically fill out blanks of a vector with the preceding...

Description Usage Arguments Value Note Author(s) See Also Examples

Description

autoFill is commonly used to generate labels from columns of a spreadsheet when many cells are left blank in order to save a lot of typing. For instance, c("a","","","b","") becomes c("a","a","a","b","b")

Usage

1
autoFill(x, squash = FALSE)

Arguments

x

a vector of character strings

squash

If set to TRUE then leading and trailing spaces are removed which is useful if spaces are inadvertantly typed because these may be hard to track down. Default: FALSE

Value

x

a vector of character strings with blank strings replaced by preceding non–blank strings

Note

While this function may be called directly, it is more often called by makeLabel

Author(s)

Peter Baker p.baker1@uq.edu.au

See Also

makeLabel uses autoFill to create labels from two columns of marker names

Examples

1
2
3
4
5
6
  ## description: fill out blanks of a vector with preceeding label
  label.1 <- c("a","","","b","")
  print(autoFill(label.1))

  label.2 <- c("agc","","","","gct5","","ccc","","")
  print(autoFill(label.2))

polySegratio documentation built on May 2, 2019, 6:09 p.m.