% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/printm.R
\name{printm}
\alias{printm}
\alias{Printm}
\title{Print multiple objects together with their names \cr
(Compact and better version of Print)}
\usage{
printm(
  ...,
  .delim. = " ",
  .NAchar. = ".",
  .FILL. = ".^",
  fmt = "",
  .fmt. = "",
  .flag. = " ",
  .printrownum. = 1,
  .lj. = 0,
  .debug. = 0
)

Printm(
  ...,
  .delim. = " ",
  .NAchar. = ".",
  .FILL. = ".^",
  fmt = "",
  .fmt. = "",
  .flag. = " ",
  .printrownum. = 1,
  .lj. = 0,
  .debug. = 0
)
}
\arguments{
\item{...}{objects to be printed}

\item{.delim.}{delimiter string}

\item{.NAchar.}{a character to indicate NA
(One or two single characters, a double byte character, or "" for "na".)}

\item{.FILL.}{not used.}

\item{fmt}{a string containing format specification in the form: wid.dig}

\item{.fmt.}{same as fmt (high precedence)}

\item{.flag.}{flag options for formatC}

\item{.printrownum.}{= 0 not to print row numbers for a vector}

\item{.lj.}{= 1 to left justify character vectors}

\item{.debug.}{= 1 to print debugging info}
}
\description{
Print multiple objects together with their names \cr
(Compact and better version of Print)
}
\details{
This function can print data.frames and list objects together
with other objects.
In contrast, \code{lazy.tools::Print} prints data.frames or lists
separately.

Object named \code{fmt} cannot be printed unless  \code{.fmt.} is given.

List objects cannot be formatted. \cr
Data.frames can only be formatted by digits= option which
specifies the length of the field.
Better use \code{Hmisc::format.df} to format data.frames.

When the actual arguments consist of string literals or numbers,
they will be printed without names.

The string literals will be printed without names.

The string literals "/" or "\\n" indicate new line when they are not
the first object of ... .

The native vectors will be printed as column vectors.
If a vector has a name, it will be printed as row names.
If a vector does not have name, numeric numbers will be printed as
row names unless \code{.printrownum.=0} is given.

If the objects contain UTF-8 characters, the result may be misleading
due to the bug of \code{print.data.frame} method.

\code{fmt} or \code{.fmt.} contain, if any,
 formats to be used separated by blanks: \cr
 \code{fmt="Width.Digits"} will use the following formatC function \cr
 \code{formatC( object, format="f", width=Width, digits=Digits )} \cr
 to format the object.

 The first element, separated by blanks, will be applied to the first
 object of ..., the 2nd element to the 2nd object, and so on. \cr
 However, when the first object of ... is a string literal, the first
 format element will be applied to the 2nd object in ... .

 If there are more objects in ... than length(fmt),
 the last fmt value will be used to fill.



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{
df1 <- data.frame(x=1:3, y=11:13, row.names=paste("rn",1:3,sep=""))
df1[1,1] <- NA
df2 <- data.frame(x=21:24, y=31:34)
df2[2,2] <- NA
df3 <- data.frame(aa=31:34+.12345, bb=51:54)
df3[2,3] <- NA
mat <- matrix(1:6,3,2, dimnames=list(NULL,c("c1","C2")))
mat[3,2] <- NA
array <- array(1:12, dim=c(3,2,2))
array[1,1,1] <- NA
list <- list(df1,df2)
df <- as.data.frame(rbind(df1,df2))
df[,2] <- as.character(df[,2])
let <- letters[1:4]
names(let) <- toupper(let)
let[2] <- NA
printm( "title",1:3, df1, df2, df3, "/", list, df2+df2, mat, array
        , "newline", "\n", let, letters[1:2], letters[2] )

# vector, matrix and array with format
printm( mat[1,], mat, array, fmt="5.0 5.2 6.3")
# data frame with format: wid part of wid.dig will be used as digits=wid.
printm( df1+0.12345, df1+0.12345, df1+0.12345, fmt="3 4 7")

# no blank line before but a blank line after.
cat("No blank lines.\n")
printm(mat)
cat("One blank line above.\n")
cat("To insert a blank line, use below.\n")
printm("","/", mat+mat)

}
