mycalc: A vector arithmetic function

Description Usage Arguments Examples

View source: R/mycalc.R

Description

This is a function which takes three arguments, “x”, “y”, and “fun”, which stands for “function”. Arguments “x” and “y” are vectors or matrices, while argument “fun” will has four possible values: “sum”, “subtract”, “divide”, “multiply”.Function mycalc will use conditional statements to choose the correct calculation to make based on the value you argument value given to operator.

Usage

1
mycalc(x, y, fun)

Arguments

x

A vector or matrice

y

A vector or matrice

Examples

1
2
3
4
mycalc(x=x,y=y,"sum")
mycalc(x=x,y=y,"subtract")
mycalc(x=x,y=y,"divide")
mycalc(x=x,y=y,"multiply")

bilintoh/TBilintoh_GEOG246346-assignments documentation built on Feb. 11, 2020, 12:03 a.m.