• R/O
  • SSH

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得cocoawindowspythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdombtronvb.netdirectxarduinopreviewerゲームエンジン

Commit MetaInfo

Revision7b4c16c8fccd31e5de031696a9ff23ee7c2d8450 (tree)
Zeit2022-06-30 08:56:43
AutorLorenzo Isella <lorenzo.isella@gmai...>
CommiterLorenzo Isella

Log Message

I rewrote the add_total function.

Ändern Zusammenfassung

Diff

diff -r 9134eea115a1 -r 7b4c16c8fccd R-codes/stat_lib.R
--- a/R-codes/stat_lib.R Wed Jun 29 17:30:42 2022 +0200
+++ b/R-codes/stat_lib.R Thu Jun 30 01:56:43 2022 +0200
@@ -4631,13 +4631,21 @@
46314631 ## I slightly modify a function from janitor to do add the totals.
46324632
46334633
4634+## add_total <- function(x, pos=1, ...){
4635+## adorn_totals(x, ...) %>%
4636+## as_tibble() %>%
4637+## move_row(nrow(.)+1, pos)
4638+## }
4639+
4640+## I rewrite the function above using the native pipe.
4641+
46344642 add_total <- function(x, pos=1, ...){
4635- nn <- nrow(x)+1
4636-
4637- adorn_totals(x, ...) |> ## %>%
4638- as_tibble() |> ## %>%
4639- move_row(nn, pos)
4640-}
4643+ adorn_totals(x, ...) |>
4644+ as_tibble() |>
4645+ (\(x) move_row(x, nrow(x)+1, pos))()
4646+
4647+}
4648+
46414649
46424650
46434651 ## See split(d, ceiling(seq_along(d)/20))