vector¶
Create¶
| Action | Code | Details |
|---|---|---|
| Define vector |
|
|
| Define with n repeated values v |
|
|
| Define with n repeated values v |
|
|
| Zeros, length n |
|
|
| NaNs, length n |
|
|
| Sequence from a to b |
|
|
| Sequence between a to b of length n |
|
Test¶
| Action | Code | Details |
|---|---|---|
| Is vector |
|
is.vector() returns true for lists as well! |
| Is empty |
|
|
| Contains value v |
|
|
| Contains NA value(s) |
|
|
| Contains each of the values in vector v |
|
|
| Does not contain value v |
|
Extract¶
| Action | Code | Details |
|---|---|---|
| Length |
|
|
| First element |
|
|
| Last element |
|
|
| Last element |
|
Aggregate¶
| Action | Code | Details |
|---|---|---|
| Sum elements |
|
|
| Mean of elements |
|
|
| Mode |
|
|
| Mode of positive integers 1:K |
|
|
| Compute function per group, as list |
|
Outputs a list with the results per group |
Indexing¶
| Action | Code | Details |
|---|---|---|
| TRUE values |
|
|
| FALSE values |
|
|
| Index of smallest value |
|
|
| Index of largest value |
|
Derive¶
Order¶
| Action | Code | Details |
|---|---|---|
| Sort descending |
|
|
| Reverse |
|
|
| Shuffle |
|
Map¶
Element-wise operations
| Action | Code | Details |
|---|---|---|
| If-else with constant results |
|
|
| If-else with element-specific results |
|
|
| Replace NAs by zeros |
|
|
| Replace specific values by zeros |
|
|
| Replace elements at index with given values |
|
|
| Order by value, breaking ties with further args |
|
|
| Ranking, with ties option |
|
|
| Clip values below a |
|
|
| Clip values above b |
|
|
| Find pairwise min between two vectors |
|
|
| Find pairwise max between two vectors |
|
|
| Discretize values into bin number |
|
|
| Discretize values into n levels |
|
|
| Discretize values in specified intervals |
|
|
| Linear interpolation |
|
|
| Spline interpolation |
|
|
| Smoothing spline interpolation |
|
Grow¶
| Action | Code | Details |
|---|---|---|
| Repeat vector n times |
|
|
| Repeat vector up to length n |
|
Shrink¶
| Action | Code | Details |
|---|---|---|
| Exclude NA |
|
|
| Exclude NA |
|
|
| Exclude NA |
|
|
| Exclude non-finite values |
|
|
| Exclude non-finite values |
|
|
| Lagged difference |
|
|
| Sample n elements |
|
Convert¶
| Action | Code | Details |
|---|---|---|
| Split into a list of vectors, according to a grouping vector |
|
Can be undone by unsplit(y, g) |
| Running-length encoding |
|