knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(nclCowley)

Examples

Use case 1

The function allows the user to pass single values.

MultiplyBy23(2)

MultiplyBy23(1.5)

Use case 2

The user may also pass more than one parameters in the form of a vector

MultiplyBy23(1:5)

MultiplyBy23(c(3, 5, 7))

Use case 3

This function can also be used on matrices to perform scalar multiplication

Matr = matrix(c(2,1,3,2), 2, 2)
print(Matr)

MultiplyBy23(Matr)

Non Examples

Note that passing a string to this function will produce an error.

MultiplyBy23("a")


nclJoshCowley/nclCowley documentation built on Feb. 12, 2020, 12:24 p.m.