
COMPLEX DATA TYPES A-203
Compound
Data Types
(cont.)
Lists analogous to vectors, with elements of possibly different types.
list() generates a list.
Syntax: list(hcomponentsi)
[[ ]] access to components of a list by index.
hlist$componenti
access by names.
Example: l <- list(name = "xyz", age = 22, fak = "math")
> l[[2]]
22
>l$age
22
Data Frames data frames analogous to arrays resp. lists, with column-wise uni-
form type and uniform column length.
data.frame()
analogous to list(), but restrictions have to be satisfied.
attach() attaches a database to the current search list. For access
to components the component name will be sufficient.
detach()