strbreak: Break Character Strings to Fit Width

Description Usage Arguments Author(s) See Also Examples

View source: R/strings.R

Description

Inserts line breaks (collapse) into input character strings. The main intention of this function is to prepare long strings for printing, so the output is not wider than width.

Usage

1
  strbreak(x, width=getOption("width"), exdent=2, collapse="\n")

Arguments

x

a character vector

width

a positive integer giving the width of the output.

exdent

a positive integer specifying the indentation of subsequent lines after the first line.

collapse

a character. This is inserted to break lines.

Author(s)

Wolfgang Huber http://www.ebi.ac.uk/huber

See Also

strwrap, substring

Examples

1
2
longString = paste(rep(LETTERS, 10), collapse="", sep="")
cat(strbreak(longString))

Example output

Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZAB
  CDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZAB
  CDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZAB
  CDEFGHIJKLMNOPQRSTUVWXYZ

Biobase documentation built on Nov. 8, 2020, 6:52 p.m.