% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Print_all.R
\name{Print}
\alias{Print}
\title{Print arguments with their names and formats}
\usage{
Print(
  ...,
  fmt = NULL,
  NAchar = ".",
  fuzz = -1,
  fuzzchar = "..",
  sep = ",",
  removeatt = 0,
  printrowname = 0,
  printrownames = 0,
  debug = 0
)
}
\arguments{
\item{...}{objects to be printed with name.}

\item{fmt}{A vector of formatC to be used}

\item{NAchar}{a character to represent NA.}

\item{fuzz}{Those elements which satisfy abs(X) < fuzz will be printed.}

\item{fuzzchar}{Replacement character(s) for those abs(X) < fuzz.}

\item{sep}{character to be used as the delimiter.}

\item{removeatt}{= 1 to remove the attributes from each of ... .}

\item{printrowname}{= 0 not to print rownames when printing vector.}

\item{printrownames}{Same as printrowname.}

\item{debug}{= 1 to dump intermediate result.}
}
\value{
The first element of ... invisibly.
}
\description{
Print arguments with their names and formats
}
\details{
If ... contains lists or data.frames, they will be printed separetely.#'
\cr
  Except for the case when ... consists of a single vector,
  vectors will be printed as column vectors without row/col names. \cr
  To add rownames to vectors, specify printrowname=1. \cr
  "/" or "\\n" can be used as the line break. \cr
\cr
  If any of the input matrices does not have row/col names
  they will be generated using "r" and "c" as the roots.
\cr
  If the first argument is a number or a quoted string, it will be printed
  as it is (without name.) \cr
\cr
  When there are only two objects to be printed,
  and the first one is a constant and the second one is not a matrix,
  there will be no line breaks  between the first and the second objects
  unless the first one has "\\n". \cr
   compare:  \cr
\preformatted{
    Print("first", pi)
    Print("first\n", pi )
    Print("first", pi, pi )
}
\cr

fmt  contains formats to be used separated by commas or blanks: \cr
 \code{fmt="FNameWid.Digits"} will use the following formatC function \cr
 \code{formatC( object, format="FName", width=Wid, digits=Digits )} \cr
 to format the object. \cr
 If there are more objects in ... than length(fmt),
 the last fmt value will be used to fill.
 \cr

When fmt is given, the attributes of the object may be printed together.\cr
Use removeatt=1 to remove all the attributes except dimnames and dim.


The first element of ... will be returned invisibly so that
this function can be used with pipe operator. \cr
Use \code{capture.output} function, not the return value,
to utilize the printed output of this function.
}
\examples{
bool <- TRUE; num <- 1; cpl <- 1+1i; str <- "Hello."
vec <- 1:10; mat <- matrix(c(1, 2, 3), 3, 2)
lis <- list(a=1:3, b="abc",NA); df <- data.frame(a=1:2,b=2:3,c="cc")
Print(bool, num, cpl, str, lis, vec, df, mat, plot, sin(0))

A=demomat(3,2)
Print("This is what I need.", A)
Print(A/22)
Print(A/22, A/22, fmt="6.2, 8.4")
Print(A/22, fuzz=0.6)

Print(diag(5),1:3)
Print(diag(5), diag(2))
Print(diag(5), "/", diag(5))
char_vec <- "This is a character vector."
Print("string", char_vec, t(1:2))

B <- demomat(3,3,2,supermat=2)
Print(B,fmt="6.3")
Print(B,fmt="6.3", removeatt=1)

# with pipe
C <- demomat(2,2, root="c")  |> Print(A)
print(C)
C <- demomat(2,2, root="c")  |> Print(A, .=_)
print(C)

}
