press.Rd
Take all coe list columns, prefix them with list column names and return a tidy tibble. This function is typically used for analyses, after morphometrics.
press(x, keep_others)
x | |
---|---|
keep_others | logical whether to return other columns ( |
iris %>% mom %>% press#>#> # A tibble: 150 x 5 #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> <dbl> <dbl> <dbl> <dbl> <fct> #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3 1.4 0.2 setosa #> 3 4.7 3.2 1.3 0.2 setosa #> 4 4.6 3.1 1.5 0.2 setosa #> 5 5 3.6 1.4 0.2 setosa #> 6 5.4 3.9 1.7 0.4 setosa #> 7 4.6 3.4 1.4 0.3 setosa #> 8 5 3.4 1.5 0.2 setosa #> 9 4.4 2.9 1.4 0.2 setosa #> 10 4.9 3.1 1.5 0.1 setosa #> # … with 140 more rows #> ❯mom_tbl#> # A tibble: 40 x 42 #> type fake coe_a1 coe_a2 coe_a3 coe_a4 coe_b1 coe_b2 coe_b3 coe_b4 coe_c1 #> <fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 whis… a -143. 5.29 23.0 -11.4 -13.9 -21.9 11.4 13.6 64.4 #> 2 whis… a -134. 8.42 20.8 -2.59 -19.3 -30.3 8.69 4.37 57.0 #> 3 whis… a -124. 6.75 12.8 -2.68 -10.3 -27.2 5.72 5.11 38.7 #> 4 whis… a -98.0 5.14 17.2 -2.29 -13.8 -20.1 7.03 3.35 50.1 #> 5 whis… a -125. 11.8 20.8 1.80 -14.6 -46.3 7.36 -2.28 47.0 #> 6 whis… a -124. 10.0 11.9 -4.65 -24.8 -23.8 7.98 4.92 55.2 #> 7 whis… a -115. 6.06 15.5 -7.01 -17.9 -21.1 7.42 9.47 58.6 #> 8 whis… a -128. 7.07 17.0 -1.58 -12.8 -31.1 5.42 3.24 35.8 #> 9 whis… a -118. 5.52 14.4 -3.09 -11.9 -27.1 4.01 6.98 34.7 #> 10 whis… a -139. 6.22 22.9 -2.03 -13.3 -32.2 7.52 5.69 52.9 #> # … with 30 more rows, and 31 more variables: coe_c2 <dbl>, coe_c3 <dbl>, #> # coe_c4 <dbl>, coe_d1 <dbl>, coe_d2 <dbl>, coe_d3 <dbl>, coe_d4 <dbl>, #> # coe2_a1 <dbl>, coe2_a2 <dbl>, coe2_a3 <dbl>, coe2_a4 <dbl>, coe2_a5 <dbl>, #> # coe2_a6 <dbl>, coe2_b1 <dbl>, coe2_b2 <dbl>, coe2_b3 <dbl>, coe2_b4 <dbl>, #> # coe2_b5 <dbl>, coe2_b6 <dbl>, coe2_c1 <dbl>, coe2_c2 <dbl>, coe2_c3 <dbl>, #> # coe2_c4 <dbl>, coe2_c5 <dbl>, coe2_c6 <dbl>, coe2_d1 <dbl>, coe2_d2 <dbl>, #> # coe2_d3 <dbl>, coe2_d4 <dbl>, coe2_d5 <dbl>, coe2_d6 <dbl>x %>% press(keep_others=FALSE) # eg for PCA#> # A tibble: 40 x 40 #> coe_a1 coe_a2 coe_a3 coe_a4 coe_b1 coe_b2 coe_b3 coe_b4 coe_c1 coe_c2 coe_c3 #> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 -143. 5.29 23.0 -11.4 -13.9 -21.9 11.4 13.6 64.4 -3.15 -18.0 #> 2 -134. 8.42 20.8 -2.59 -19.3 -30.3 8.69 4.37 57.0 -3.16 -15.7 #> 3 -124. 6.75 12.8 -2.68 -10.3 -27.2 5.72 5.11 38.7 -4.58 -9.03 #> 4 -98.0 5.14 17.2 -2.29 -13.8 -20.1 7.03 3.35 50.1 -2.63 -14.1 #> 5 -125. 11.8 20.8 1.80 -14.6 -46.3 7.36 -2.28 47.0 -7.60 -12.8 #> 6 -124. 10.0 11.9 -4.65 -24.8 -23.8 7.98 4.92 55.2 -5.81 -10.9 #> 7 -115. 6.06 15.5 -7.01 -17.9 -21.1 7.42 9.47 58.6 -2.82 -15.4 #> 8 -128. 7.07 17.0 -1.58 -12.8 -31.1 5.42 3.24 35.8 -3.31 -9.05 #> 9 -118. 5.52 14.4 -3.09 -11.9 -27.1 4.01 6.98 34.7 -3.16 -8.98 #> 10 -139. 6.22 22.9 -2.03 -13.3 -32.2 7.52 5.69 52.9 -4.40 -14.6 #> # … with 30 more rows, and 29 more variables: coe_c4 <dbl>, coe_d1 <dbl>, #> # coe_d2 <dbl>, coe_d3 <dbl>, coe_d4 <dbl>, coe2_a1 <dbl>, coe2_a2 <dbl>, #> # coe2_a3 <dbl>, coe2_a4 <dbl>, coe2_a5 <dbl>, coe2_a6 <dbl>, coe2_b1 <dbl>, #> # coe2_b2 <dbl>, coe2_b3 <dbl>, coe2_b4 <dbl>, coe2_b5 <dbl>, coe2_b6 <dbl>, #> # coe2_c1 <dbl>, coe2_c2 <dbl>, coe2_c3 <dbl>, coe2_c4 <dbl>, coe2_c5 <dbl>, #> # coe2_c6 <dbl>, coe2_d1 <dbl>, coe2_d2 <dbl>, coe2_d3 <dbl>, coe2_d4 <dbl>, #> # coe2_d5 <dbl>, coe2_d6 <dbl>