franknarf1 / r-tutorial

This book covers the essentials of using R
Creative Commons Zero v1.0 Universal
12 stars 4 forks source link

Suggesting edit to r-tutorial #26

Closed chinsoon12 closed 6 years ago

chinsoon12 commented 6 years ago

Hi,

Somewhere in your r-tutorial green DETAILS box under section 3.2.2 Slicing, you mentioned that

Second, DT[1:2] will slice the first two columns instead of the first two rows, thanks to the fact that data frames (and data.tables) are lists and the no-comma usage of [ triggers list slicing.

Should it be slice first two rows instead of first two columns?

franknarf1 commented 6 years ago

Thanks! I have now changed it to say:

Second, DF[1:2] will slice the first two columns instead of the first two rows, thanks to the fact that no-comma usage of [ on a data.frame triggers list slicing.

The way I wrote it was not a typo, but I can see how it could be unclear. This might not be up on the web version soon since I am not very adept with Github yet.