Slot "salary":
[1] 55000Slot "union":
[1] TRUENote that the member variables are calledslots, referenced via the@sym-
bol. Here’s an example:> joe@salary
[1] 55000We can also use theslot()function, say, as another way to query Joe’s
salary:> slot(joe,"salary")
[1] 55000We can assign components similarly. Let’s give Joe a raise:> joe@salary <- 65000
> joe
An object of class "employee"
Slot "name":
[1] "Joe"Slot "salary":
[1] 65000Slot "union":
[1] TRUENah, he deserves a bigger raise that that:> slot(joe,"salary") <- 88000
> joe
An object of class "employee"
Slot "name":
[1] "Joe"Slot "salary":
[1] 88000Slot "union":
[1] TRUE224 Chapter 9