hello: An S3 generic function example

Description Usage Arguments Value Examples

View source: R/S3.R

Description

Say hello on difference classes.

Usage

1
2
3
4
5
6
7
hello(x)

## Default S3 method:
hello(x)

## S3 method for class 'character'
hello(x)

Arguments

x

an arbitrary R object

Value

The class of x is printed as a side-effect.

Examples

1
2
3
hello(1)
hello("a")
hello(structure(1, class = "world"))

yihui/rmini documentation built on May 3, 2021, 4:26 a.m.