ez.print: wrapper of 'cat', cat(string, "\n", sep="")

View source: R/basic.R

ez.printR Documentation

wrapper of cat, cat(string, "\n", sep="")

Description

wrapper of cat, cat(string, "\n", sep="")

Usage

ez.print(
  string,
  file = "",
  append = TRUE,
  sep = "",
  fill = FALSE,
  labels = NULL
)

Arguments

string

a single character vector, other types will be auto converted with as.character() by cat()
ez.print(factor(4:5)) –> 12
ez.print(c(pi,'=',3)) –> 3.14159265358979=3
ez.print(c('var','\t','p')) –> var\tp

file

filepath, default ”=print to console only; if provided, save to a file and print to console

append

T/F

sep

default empty. a character vector of strings to append after each element.

fill

a logical or (positive) numeric controlling how the output is broken into successive lines. If FALSE (default), only newlines created explicitly by "\n" are printed. Otherwise, the output is broken into lines with print width equal to the option width if fill is TRUE, or the value of fill if this is numeric. Non-positive fill values are ignored, with a warning.

labels

character vector of labels for the lines printed. Ignored if fill is FALSE.

Details

do not use R print, not actually printing \n

Value

each print generates a new line automatically

See Also

sprintf, ez.log, ez.join

Examples

# cat("hello","world",file="output.txt",sep="\n",append=TRUE)

jerryzhujian9/zmisc documentation built on March 9, 2024, 12:49 a.m.