From 107d07bcf278cf6ecfd8ce148a7f5a5ba614a451 Mon Sep 17 00:00:00 2001 From: Waldir Leoncio Date: Tue, 14 Jul 2020 14:09:57 +0200 Subject: [PATCH] Translated fix from base MATLAB --- R/fix.R | 5 +++++ man/fix.Rd | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 R/fix.R create mode 100644 man/fix.Rd diff --git a/R/fix.R b/R/fix.R new file mode 100644 index 0000000..50ec46e --- /dev/null +++ b/R/fix.R @@ -0,0 +1,5 @@ +#' @title Round toward zero +#' @description Rounds each element of input to the nearest integer towards zero. Basically the same as trunc() +#' @param X input element +#' @author Waldir Leoncio +fix <- function(X) trunc(X) \ No newline at end of file diff --git a/man/fix.Rd b/man/fix.Rd new file mode 100644 index 0000000..91b4678 --- /dev/null +++ b/man/fix.Rd @@ -0,0 +1,17 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/fix.R +\name{fix} +\alias{fix} +\title{Round toward zero} +\usage{ +fix(X) +} +\arguments{ +\item{X}{input element} +} +\description{ +Rounds each element of input to the nearest integer towards zero. Basically the same as trunc() +} +\author{ +Waldir Leoncio +}