% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/statistics.R
\name{row_calculation}
\alias{row_calculation}
\title{Perform Row Wise Calculations}
\usage{
row_calculation(data_frame, statistics, ..., round_digits = NULL)
}
\arguments{
\item{data_frame}{A data frame in which are the values to be calculated.}

\item{statistics}{Available functions: "sum", "freq", "mean", "median", "mode",
"min", "max".}

\item{...}{Variable names of the value variables.}

\item{round_digits}{The number of decimal places the values should be rounded to.}
}
\value{
Returns a numeric vector.
}
\description{
Perform row wise calculations on numeric variables.
}
\examples{
# Example data frame
my_data <- data.frame(var1 = 1:5,
                      var2 = c(6, 7, 8, NA, 10),
                      var3 = 11:15)

# Calculate new variables
my_data[["sum"]]  <- my_data |> row_calculation("sum",  var1, var2, var3)
my_data[["mean"]] <- my_data |> row_calculation("mean", var1:var3)
}
