|
1 | 1 |
|
2 | 2 | <!-- README.md is generated from README.Rmd. Please edit that file --> |
| 3 | + |
3 | 4 | <!-- # rearrr <a href='https://github.com/LudvigOlsen/rearrr'><img src='man/figures/rearrr_logo_242x280_250dpi.png' align="right" height="140" /></a> --> |
4 | 5 |
|
5 | 6 | # rearrr |
|
8 | 9 | **Authors:** [Ludvig R. Olsen](https://www.ludvigolsen.dk/) ( |
9 | 10 | <r-pkgs@ludvigolsen.dk> ) |
10 | 11 | <a href='https://twitter.com/ludvigolsen'><img src='man/figures/icons8-twitter.svg' height="17" /></a><br/> |
11 | | -**License:** [MIT](https://opensource.org/license/mit/) <br/> |
| 12 | +**License:** [MIT](https://opensource.org/license/mit) <br/> |
12 | 13 | **Started:** April 2020 |
13 | 14 |
|
14 | 15 | [](https://cran.r-project.org/package=rearrr) |
@@ -66,57 +67,59 @@ Development version: |
66 | 67 | > `devtools::install_github("LudvigOlsen/rearrr")` |
67 | 68 |
|
68 | 69 | <!-- ## Vignettes --> |
| 70 | + |
69 | 71 | <!-- `rearrr` contains a number of vignettes with relevant use cases and descriptions: --> |
| 72 | + |
70 | 73 | <!-- > `vignette(package = "rearrr")` # for an overview --> |
71 | 74 |
|
72 | 75 | ### Rearrangers |
73 | 76 |
|
74 | | -| Function | Description | |
75 | | -|:----------------------|:----------------------------------------------------------------------------------------| |
76 | | -| `center_max()` | Center the highest value with values decreasing around it. | |
77 | | -| `center_min()` | Center the lowest value with values increasing around it. | |
78 | | -| `position_max()` | Position the highest value with values decreasing around it. | |
79 | | -| `position_min()` | Position the lowest value with values increasing around it. | |
80 | | -| `pair_extremes()` | Arrange as lowest, highest, 2nd lowest, 2nd highest, etc. | |
81 | | -| `triplet_extremes()` | Arrange as lowest, most middle, highest, 2nd lowest, 2nd most middle, 2nd highest, etc. | |
82 | | -| `closest_to()` | Order values by shortest distance to an origin. | |
83 | | -| `furthest_from()` | Order values by longest distance to an origin. | |
84 | | -| `rev_windows()` | Reverse order window-wise. | |
85 | | -| `roll_elements()` | Rolls/shifts positions of elements. | |
86 | | -| `shuffle_hierarchy()` | Shuffle multi-column hierarchy of groups. | |
| 77 | +| Function | Description | |
| 78 | +|:---|:---| |
| 79 | +| `center_max()` | Center the highest value with values decreasing around it. | |
| 80 | +| `center_min()` | Center the lowest value with values increasing around it. | |
| 81 | +| `position_max()` | Position the highest value with values decreasing around it. | |
| 82 | +| `position_min()` | Position the lowest value with values increasing around it. | |
| 83 | +| `pair_extremes()` | Arrange as lowest, highest, 2nd lowest, 2nd highest, etc. | |
| 84 | +| `triplet_extremes()` | Arrange as lowest, most middle, highest, 2nd lowest, 2nd most middle, 2nd highest, etc. | |
| 85 | +| `closest_to()` | Order values by shortest distance to an origin. | |
| 86 | +| `furthest_from()` | Order values by longest distance to an origin. | |
| 87 | +| `rev_windows()` | Reverse order window-wise. | |
| 88 | +| `roll_elements()` | Rolls/shifts positions of elements. | |
| 89 | +| `shuffle_hierarchy()` | Shuffle multi-column hierarchy of groups. | |
87 | 90 |
|
88 | 91 | ### Mutators |
89 | 92 |
|
90 | | -| Function | Description | Dimensions | |
91 | | -|:--------------------------------|:----------------------------------------------------------------------|:-------------| |
92 | | -| `rotate_2d()`, `rotate_3d()` | Rotate values around an origin in 2 or 3 dimensions. | 2 or 3 | |
93 | | -| `swirl_2d()`, `swirl_3d()` | Swirl values around an origin in 2 or 3 dimensions. | 2 or 3 | |
94 | | -| `shear_2d()`, `shear_3d()` | Shear values around an origin in 2 or 3 dimensions. | 2 or 3 | |
95 | | -| `expand_distances()` | Expand distances to an origin. | n | |
96 | | -| `expand_distances_each()` | Expand distances to an origin separately for each dimension. | n | |
97 | | -| `cluster_groups()` | Move data points into clusters around group centroids. | n | |
98 | | -| `dim_values()` | Dim values of a dimension by the distance to an n-dimensional origin. | n (alters 1) | |
99 | | -| `flip_values()` | Flip the values around an origin. | n | |
100 | | -| `roll_values()` | Shifts values and wraps to a range. | n | |
101 | | -| `wrap_to_range()` | Wraps values to a range. | n | |
102 | | -| `transfer_centroids()` | Transfer centroids from one `data.frame` to another. | n | |
103 | | -| `apply_transformation_matrix()` | Apply transformation `matrix` to `data.frame` columns. | n | |
| 93 | +| Function | Description | Dimensions | |
| 94 | +|:---|:---|:---| |
| 95 | +| `rotate_2d()`, `rotate_3d()` | Rotate values around an origin in 2 or 3 dimensions. | 2 or 3 | |
| 96 | +| `swirl_2d()`, `swirl_3d()` | Swirl values around an origin in 2 or 3 dimensions. | 2 or 3 | |
| 97 | +| `shear_2d()`, `shear_3d()` | Shear values around an origin in 2 or 3 dimensions. | 2 or 3 | |
| 98 | +| `expand_distances()` | Expand distances to an origin. | n | |
| 99 | +| `expand_distances_each()` | Expand distances to an origin separately for each dimension. | n | |
| 100 | +| `cluster_groups()` | Move data points into clusters around group centroids. | n | |
| 101 | +| `dim_values()` | Dim values of a dimension by the distance to an n-dimensional origin. | n (alters 1) | |
| 102 | +| `flip_values()` | Flip the values around an origin. | n | |
| 103 | +| `roll_values()` | Shifts values and wraps to a range. | n | |
| 104 | +| `wrap_to_range()` | Wraps values to a range. | n | |
| 105 | +| `transfer_centroids()` | Transfer centroids from one `data.frame` to another. | n | |
| 106 | +| `apply_transformation_matrix()` | Apply transformation `matrix` to `data.frame` columns. | n | |
104 | 107 |
|
105 | 108 | ### Formers |
106 | 109 |
|
107 | | -| Function | Description | |
108 | | -|:------------------|:----------------------------------------------------------------| |
109 | | -| `circularize()` | Create x-coordinates for y-coordinates so they form a circle. | |
110 | | -| `hexagonalize()` | Create x-coordinates for y-coordinates so they form a hexagon. | |
111 | | -| `square()` | Create x-coordinates for y-coordinates so they form a square. | |
| 110 | +| Function | Description | |
| 111 | +|:---|:---| |
| 112 | +| `circularize()` | Create x-coordinates for y-coordinates so they form a circle. | |
| 113 | +| `hexagonalize()` | Create x-coordinates for y-coordinates so they form a hexagon. | |
| 114 | +| `square()` | Create x-coordinates for y-coordinates so they form a square. | |
112 | 115 | | `triangularize()` | Create x-coordinates for y-coordinates so they form a triangle. | |
113 | 116 |
|
114 | 117 | ### Pipelines |
115 | 118 |
|
116 | | -| Class | Description | |
117 | | -|:----------------------|:-------------------------------------------------------------------------| |
118 | | -| `Pipeline` | Chain multiple transformations. | |
119 | | -| `GeneratedPipeline` | Chain multiple transformations and generate argument values per group. | |
| 119 | +| Class | Description | |
| 120 | +|:---|:---| |
| 121 | +| `Pipeline` | Chain multiple transformations. | |
| 122 | +| `GeneratedPipeline` | Chain multiple transformations and generate argument values per group. | |
120 | 123 | | `FixedGroupsPipeline` | Chain multiple transformations with different argument values per group. | |
121 | 124 |
|
122 | 125 | ### Generators |
@@ -762,28 +765,28 @@ generate_clusters( |
762 | 765 |
|
763 | 766 | ### Scalers |
764 | 767 |
|
765 | | -| Function | Description | |
766 | | -|:-------------------|:----------------------------------------------------------| |
767 | | -| `min_max_scale()` | Scale values to a range. | |
| 768 | +| Function | Description | |
| 769 | +|:---|:---| |
| 770 | +| `min_max_scale()` | Scale values to a range. | |
768 | 771 | | `to_unit_length()` | Scale vectors to unit length *row-wise* or *column-wise*. | |
769 | 772 |
|
770 | 773 | ### Measuring functions |
771 | 774 |
|
772 | | -| Function | Description | |
773 | | -|:------------------|:----------------------------------------------------------------| |
774 | | -| `distance()` | Calculates distance to an origin. | |
775 | | -| `angle()` | Calculates angle between points and an origin. | |
| 775 | +| Function | Description | |
| 776 | +|:---|:---| |
| 777 | +| `distance()` | Calculates distance to an origin. | |
| 778 | +| `angle()` | Calculates angle between points and an origin. | |
776 | 779 | | `vector_length()` | Calculates vector length/magnitude *row-wise* or *column-wise*. | |
777 | 780 |
|
778 | 781 | ### Helper functions |
779 | 782 |
|
780 | | -| Function | Description | |
781 | | -|:---------------------|:---------------------------------------------------------------------| |
| 783 | +| Function | Description | |
| 784 | +|:---|:---| |
782 | 785 | | `create_origin_fn()` | Creates function for finding origin coordinates (like `centroid()`). | |
783 | | -| `centroid()` | Calculates the mean of each supplied vector/column. | |
784 | | -| `most_centered()` | Finds coordinates of data point closest to the centroid. | |
785 | | -| `is_most_centered()` | Indicates whether a data point is the most centered. | |
786 | | -| `midrange()` | Calculates the midrange of each supplied vector/column. | |
787 | | -| `create_n_fn()` | Creates function for finding the number of positions to move. | |
788 | | -| `median_index()` | Calculates median index of each supplied vector. | |
789 | | -| `quantile_index()` | Calculates quantile of indices for each supplied vector. | |
| 786 | +| `centroid()` | Calculates the mean of each supplied vector/column. | |
| 787 | +| `most_centered()` | Finds coordinates of data point closest to the centroid. | |
| 788 | +| `is_most_centered()` | Indicates whether a data point is the most centered. | |
| 789 | +| `midrange()` | Calculates the midrange of each supplied vector/column. | |
| 790 | +| `create_n_fn()` | Creates function for finding the number of positions to move. | |
| 791 | +| `median_index()` | Calculates median index of each supplied vector. | |
| 792 | +| `quantile_index()` | Calculates quantile of indices for each supplied vector. | |
0 commit comments