% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/txtFrmt.R
\name{txtRound}
\alias{txtRound}
\alias{txtRound.default}
\alias{txtRound.data.frame}
\alias{txtRound.table}
\alias{txtRound.matrix}
\alias{txtRound.matrix}
\title{A convenient rounding function}
\usage{
txtRound(x, ...)

\method{txtRound}{default}(x, digits = 0, txt.NA = "", dec = ".", ...)

\method{txtRound}{data.frame}(x, ...)

\method{txtRound}{table}(x, ...)

\method{txtRound}{matrix}(x, digits = 0, excl.cols, excl.rows, ...)

\method{txtRound}{matrix}(x, digits = 0, excl.cols, excl.rows, ...)
}
\arguments{
\item{x}{The value/vector/data.frame/matrix to be rounded}

\item{...}{Passed to next method}

\item{digits}{The number of digits to round each element to.
If you provide a vector each element will apply to the corresponding columns.}

\item{txt.NA}{The string to exchange NA with}

\item{dec}{The decimal marker. If the text is in non-english decimal
and string formatted you need to change this to the apropriate decimal
indicator.}

\item{excl.cols}{Columns to exclude from the rounding procedure.
This can be either a number or regular expression. Skipped if x is a vector.}

\item{excl.rows}{Rows to exclude from the rounding procedure.
This can be either a number or regular expression.}
}
\value{
\code{matrix/data.frame}
}
\description{
If you provide a string value in X the function will try to round this if
a numeric text is present. If you want to skip certain rows/columns then
use the excl.* arguments.
}
\examples{
mx <- matrix(c(1, 1.11, 1.25,
               2.50, 2.55, 2.45,
               3.2313, 3, pi),
             ncol = 3, byrow=TRUE)
txtRound(mx, 1)
}
\seealso{
Other text formatters: \code{\link{txtMergeLines}},
  \code{\link{txtPval}}
}
