Dollar sign before a variable

To access a column, use:

my_data[ , cond]

or

my_data[[cond]]

The ith row can be accessed with:

my_data[i, ]

Combine both to obtain the desired value:

my_data[i, cond]

or

my_data[[cond]][i]

Leave a Comment