Classes


Classes

Definition: A class is a collection of functions grouped together with the data these functions act upon (i.e. a collection of variables). In the context of classes, functions are no longer called function but methods, and variables are called attributes.

Lists


In [2]:
%load_ext rmagic


The rmagic extension is already loaded. To reload it, use:
  %reload_ext rmagic

In [5]:
%%R

a = list(x1='Bob', x2=34, x3=list(1,2,3))

print(a)


$x1
[1] "Bob"

$x2
[1] 34

$x3
$x3[[1]]
[1] 1

$x3[[2]]
[1] 2

$x3[[3]]
[1] 3


Subsetting


In [ ]:

Applying


In [ ]:

Classes and lists


In [ ]:

Class attributes


In [ ]:

Class methods


In [ ]:

Generic programming


In [ ]: