Author: James Henry
Date: Dec 18, 2016
This repo contains the code to create objects of class square, with a given side length. We can then use the accompanying methods to calculate the area and perimeter of the square
Create object of class square:
#' An S3 class to represent a square
#' square
#' @param side A number to represent the length of the side
#' @return A square object with side value
#' @export
#' @examples
#' square(3)
Calculate area of square:
#' area.square() function
#' @return The area of a square with \code{side}
#' @examples
#' area(square(3))
Calculate perimeter of square:
#' perimeter.square() function
#' @return The perimeter of a square with \code{side}
#' @examples
#' perimeter(square(3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.