D
D
Daniel2021-01-17 17:48:16
R
Daniel, 2021-01-17 17:48:16

What does a comma do in R?

What does a comma give in this case: iris[, 3:5]compared with iris[3:5]like, the result is the same.

Also, what does such a case a[i, ]give?

Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniel, 2021-01-17
@TheCrossCarrier

The construct a[, i]selects data by column i,
The construct a[i, ]selects row data i
a[i]works likea[, i]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question