Learn R Programming

PhenStat (version 2.6.0)

printTabStyle: Method "printTabStyle"

Description

Makes ready list of strings to be printed in tabular form, creates a table row from it. Adds empty positions if needed in order to make all strings the same by length and adds "tabSep" character between strings. Returns text that is ready to be printed (one row of a table).

Usage

printTabStyle(textList,positions,tabSep="|")

Arguments

textList
list of strings to prepare
positions
desired length of one cell in the table
tabSep
character used to separate columns in the table; default value is "|"

Value

Returns text that is ready to be printed (one row of a table).

Examples

Run this code
    row_sep <- rep("----------",3)
    print(printTabStyle(row_sep,11))
    list1 <- c("Owner","Model","Cc")
    print(printTabStyle(list1,11))
    print(printTabStyle(row_sep,11))
    list2 <- c("Natalja","Honda","125")
    print(printTabStyle(list2,11))
    print(printTabStyle(row_sep,11))

Run the code above in your browser using DataLab