Learn R Programming

onion (version 1.5-3)

round: Rounding of onions

Description

Round elements of an onion

Usage

# S4 method for onion
round(x,digits=0)
   # S4 method for onionmat
round(x,digits=0)

Value

Return an onion

Arguments

x

Object of class onion

digits

number of digits to round to

Author

Robin K. S. Hankin

Details

For onions, coerce to a matrix, round, then coerce back to an onion. For onionmats, coerce to an onion, round, then coerce back to an onionmat.

Examples

Run this code

round(rquat()*100)
round(rquat()*100,3)

Run the code above in your browser using DataLab