- Python starts at 0, R at 1.
- Docstrings are not a standard thing in R.
| Python | R |
|---|---|
| index | rownames |
| nunique() | n_distinct() |
| min(), max() | range() |
| len() | length() |
| Path('/dir/') | file.something('dir/') |
| range(10) | c(0:9) |
| type() | class() or typeof() |
| df.shape | dim(df) |
IMPORTANT NOTES:
- In
c(1:10)R starts at 1 incl. 10, while Pythonsrange(10)starts counting from 0 till 10 (generating 10 integers). group_by()incl. a group memberNAif it is in grouping column. (This is excl. in Python)distinct()in R will includeNA, use arg.na.rm = TRUEto exclude it. (This is excl. in Python unique.)- To give a column to a function, use {{column}} in de function to actually call it.