Skip to content
Prev 377994 / 398502 Next

Accessing Data Frame

I do not know how you define "quick way," but as there is an "==" method
for data frames (see ?"==" and links therein for details), that allows the
straightforward use of basic R functionality:

## using your 'deck' and 'topCard' examples:
face   suit value
1 king spades    13
face   suit value
2 queen spades    12
3  jack spades    11
4   ten spades    10
face   suit value
1 king spades    13
3 jack spades    11
4  ten spades    10

This approach can be trivially changed to using only a subset of columns to
define the "filter."

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Thu, Jan 3, 2019 at 9:16 AM Benoit Galarneau <benoit.galarneau at polymtl.ca>
wrote: