galaaz 2.1.7 → 2.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot.Rmd +63 -58
- data/blogs/galaaz_ggplot/galaaz_ggplot.log +59 -68
- data/blogs/galaaz_ggplot/galaaz_ggplot.md +91 -84
- data/blogs/galaaz_ggplot/galaaz_ggplot.tex +125 -94
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-html/midwest_rb.png +0 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-html/scatter_plot_rb.png +0 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-markdown_github/midwest_rb.png +0 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-markdown_github/scatter_plot_rb.png +0 -0
- data/blogs/gknit/gknit.Rmd +33 -28
- data/blogs/gknit/gknit.md +47 -42
- data/blogs/gknit/gknit.tex +1368 -0
- data/blogs/gknit/gknit_files/figure-html/bubble-1.png +0 -0
- data/blogs/gknit/gknit_files/figure-html/diverging_bar.png +0 -0
- data/blogs/gknit/gknit_files/figure-latex/bubble-1.png +0 -0
- data/blogs/gknit/gknit_files/gknit_files/figure-latex/bubble-1.png +0 -0
- data/blogs/manual/manual.Rmd +129 -60
- data/blogs/manual/manual.log +289 -545
- data/blogs/manual/manual.md +551 -467
- data/blogs/manual/manual.tex +1059 -485
- data/blogs/manual/manual_files/figure-html/bubble-1.png +0 -0
- data/blogs/manual/manual_files/figure-latex/bubble-1.png +0 -0
- data/blogs/manual/manual_files/figure-markdown_github/bubble-1.png +0 -0
- data/blogs/manual/manual_files/figure-markdown_github/diverging_bar.png +0 -0
- data/blogs/manual/manual_files/manual_files/figure-latex/bubble-1.png +0 -0
- data/blogs/nse_dplyr/nse_dplyr.Rmd +28 -7
- data/blogs/nse_dplyr/nse_dplyr.log +49 -153
- data/blogs/nse_dplyr/nse_dplyr.md +676 -705
- data/blogs/nse_dplyr/nse_dplyr.tex +1589 -0
- data/blogs/oh_my/oh_my.Rmd +193 -55
- data/blogs/oh_my/oh_my.log +265 -95
- data/blogs/oh_my/oh_my.md +236 -95
- data/blogs/oh_my/oh_my.tex +1976 -68
- data/blogs/ruby_plot/ruby_plot.Rmd +42 -34
- data/blogs/ruby_plot/ruby_plot.log +101 -99
- data/blogs/ruby_plot/ruby_plot.md +52 -46
- data/blogs/ruby_plot/ruby_plot.tex +134 -102
- data/blogs/ruby_plot/ruby_plot_files/figure-html/dose_len.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_delivery.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_dose.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color2.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_decorations.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_jitter.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_points.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/final_box_plot.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/final_violin_plot.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/violin_with_jitter.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/dose_len.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facet_by_delivery.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facet_by_dose.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_by_delivery_color.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_by_delivery_color2.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_with_decorations.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_with_jitter.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_with_points.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/final_box_plot.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/final_violin_plot.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/violin_with_jitter.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/dose_len.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/facet_by_delivery.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/facet_by_dose.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/facets_by_delivery_color.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/facets_by_delivery_color2.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/facets_with_decorations.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/facets_with_jitter.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/facets_with_points.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/final_box_plot.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/final_violin_plot.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/ruby_plot_files/figure-latex/violin_with_jitter.png +0 -0
- data/lib/galaaz/cli.rb +51 -10
- data/script/omarchy/README.md +1 -1
- data/script/omarchy/galaaz-guide.sh +1 -1
- data/sty/galaaz.sty +22 -0
- data/version.rb +1 -1
- metadata +19 -1
data/blogs/gknit/gknit.md
CHANGED
|
@@ -10,6 +10,7 @@ output:
|
|
|
10
10
|
pdf_document:
|
|
11
11
|
includes:
|
|
12
12
|
in_header: ["../../sty/galaaz.sty"]
|
|
13
|
+
keep_tex: yes
|
|
13
14
|
number_sections: yes
|
|
14
15
|
html_document:
|
|
15
16
|
self_contained: true
|
|
@@ -347,15 +348,17 @@ a linear regression line (method = "lm") for every manufacturer.
|
|
|
347
348
|
library(ggplot2)
|
|
348
349
|
data(mpg, package="ggplot2")
|
|
349
350
|
|
|
350
|
-
mpg_select <- mpg[
|
|
351
|
+
mpg_select <- mpg[
|
|
352
|
+
mpg$manufacturer %in% c("audi", "ford", "honda", "hyundai"),
|
|
353
|
+
]
|
|
351
354
|
|
|
352
355
|
# Scatterplot
|
|
353
356
|
theme_set(theme_bw()) # pre-set the bw theme.
|
|
354
|
-
g <- ggplot(mpg_select, aes(displ, cty)) +
|
|
357
|
+
g <- ggplot(mpg_select, aes(displ, cty)) +
|
|
355
358
|
labs(subtitle="mpg: Displacement vs City Mileage",
|
|
356
359
|
title="Bubble chart")
|
|
357
360
|
|
|
358
|
-
g + geom_jitter(aes(col=manufacturer, size=hwy)) +
|
|
361
|
+
g + geom_jitter(aes(col=manufacturer, size=hwy)) +
|
|
359
362
|
geom_smooth(aes(col=manufacturer), method="lm", se=F)
|
|
360
363
|
```
|
|
361
364
|
|
|
@@ -479,60 +482,61 @@ ten aspects are:
|
|
|
479
482
|
# copy the R variable :mtcars to the Ruby mtcars variable
|
|
480
483
|
mtcars = ~R[:mtcars]
|
|
481
484
|
|
|
482
|
-
#
|
|
483
|
-
#
|
|
484
|
-
# data for plotting
|
|
485
|
+
# New column 'car_name' for plotting (rownames alone are not
|
|
486
|
+
# usable as plot data).
|
|
485
487
|
mtcars.car_name = R.rownames(:mtcars)
|
|
486
488
|
|
|
487
|
-
#
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
# deviation 'sd'. The vector is then rounded to two digits with 'round 2'
|
|
491
|
-
mtcars.mpg_z = ((mtcars.mpg - mtcars.mpg.mean)/mtcars.mpg.sd).round 2
|
|
489
|
+
# Normalized mpg in column mpg_z: (mpg - mean) / sd, rounded.
|
|
490
|
+
mtcars.mpg_z =
|
|
491
|
+
((mtcars.mpg - mtcars.mpg.mean) / mtcars.mpg.sd).round 2
|
|
492
492
|
|
|
493
|
-
#
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
mtcars.mpg_type = (mtcars.mpg_z < 0).ifelse("below", "above")
|
|
493
|
+
# mpg_type: 'below' if mpg_z < 0, else 'above' (vectorized ifelse).
|
|
494
|
+
mtcars.mpg_type =
|
|
495
|
+
(mtcars.mpg_z < 0).ifelse("below", "above")
|
|
497
496
|
|
|
498
|
-
#
|
|
497
|
+
# Order rows by mpg_z ascending.
|
|
499
498
|
mtcars = mtcars[mtcars.mpg_z.order, :all]
|
|
500
499
|
|
|
501
|
-
#
|
|
502
|
-
mtcars.car_name =
|
|
500
|
+
# Factor car_name so plot keeps sorted order.
|
|
501
|
+
mtcars.car_name =
|
|
502
|
+
mtcars.car_name.factor levels: mtcars.car_name
|
|
503
503
|
|
|
504
|
-
#
|
|
504
|
+
# First records of the final data frame
|
|
505
505
|
puts mtcars.head
|
|
506
506
|
```
|
|
507
507
|
|
|
508
508
|
```
|
|
509
|
-
## mpg cyl disp hp drat wt qsec vs am gear
|
|
510
|
-
## Cadillac Fleetwood 10.4 8 472 205 2.93 5.250 17.98 0 0 3
|
|
511
|
-
## Lincoln Continental 10.4 8 460 215 3.00 5.424 17.82 0 0 3
|
|
512
|
-
## Camaro Z28 13.3 8 350 245 3.73 3.840 15.41 0 0 3
|
|
513
|
-
## Duster 360 14.3 8 360 245 3.21 3.570 15.84 0 0 3
|
|
514
|
-
## Chrysler Imperial 14.7 8 440 230 3.23 5.345 17.42 0 0 3
|
|
515
|
-
## Maserati Bora 15.0 8 301 335 3.54 3.570 14.60 0 1 5
|
|
516
|
-
##
|
|
517
|
-
## Cadillac Fleetwood
|
|
518
|
-
## Lincoln Continental Lincoln Continental -1.61 below
|
|
519
|
-
## Camaro Z28
|
|
520
|
-
## Duster 360
|
|
521
|
-
## Chrysler Imperial
|
|
522
|
-
## Maserati Bora
|
|
509
|
+
## mpg cyl disp hp drat wt qsec vs am gear
|
|
510
|
+
## Cadillac Fleetwood 10.4 8 472 205 2.93 5.250 17.98 0 0 3
|
|
511
|
+
## Lincoln Continental 10.4 8 460 215 3.00 5.424 17.82 0 0 3
|
|
512
|
+
## Camaro Z28 13.3 8 350 245 3.73 3.840 15.41 0 0 3
|
|
513
|
+
## Duster 360 14.3 8 360 245 3.21 3.570 15.84 0 0 3
|
|
514
|
+
## Chrysler Imperial 14.7 8 440 230 3.23 5.345 17.42 0 0 3
|
|
515
|
+
## Maserati Bora 15.0 8 301 335 3.54 3.570 14.60 0 1 5
|
|
516
|
+
## carb car_name mpg_z mpg_type
|
|
517
|
+
## Cadillac Fleetwood 4 Cadillac Fleetwood -1.61 below
|
|
518
|
+
## Lincoln Continental 4 Lincoln Continental -1.61 below
|
|
519
|
+
## Camaro Z28 4 Camaro Z28 -1.13 below
|
|
520
|
+
## Duster 360 4 Duster 360 -0.96 below
|
|
521
|
+
## Chrysler Imperial 4 Chrysler Imperial -0.89 below
|
|
522
|
+
## Maserati Bora 8 Maserati Bora -0.84 below
|
|
523
523
|
```
|
|
524
524
|
|
|
525
525
|
|
|
526
526
|
``` ruby
|
|
527
527
|
require 'ggplot'
|
|
528
528
|
|
|
529
|
-
puts mtcars.ggplot(
|
|
530
|
-
|
|
531
|
-
R.
|
|
532
|
-
|
|
533
|
-
|
|
529
|
+
puts mtcars.ggplot(
|
|
530
|
+
E.aes(x: :car_name, y: :mpg_z, label: :mpg_z)) +
|
|
531
|
+
R.geom_bar(E.aes(fill: :mpg_type),
|
|
532
|
+
stat: 'identity', width: 0.5) +
|
|
533
|
+
R.scale_fill_manual(
|
|
534
|
+
name: 'Mileage',
|
|
535
|
+
labels: R.c('Above Average', 'Below Average'),
|
|
536
|
+
values: R.c('above': '#00ba38',
|
|
537
|
+
'below': '#f8766d')) +
|
|
534
538
|
R.labs(subtitle: "Normalised mileage from 'mtcars'",
|
|
535
|
-
title: "Diverging Bars") +
|
|
539
|
+
title: "Diverging Bars") +
|
|
536
540
|
R.coord_flip
|
|
537
541
|
```
|
|
538
542
|
|
|
@@ -548,7 +552,8 @@ with the 'rb' engine. The following chunk specification will
|
|
|
548
552
|
create and inline Ruby text:
|
|
549
553
|
|
|
550
554
|
````
|
|
551
|
-
This is some text with inline Ruby accessing
|
|
555
|
+
This is some text with inline Ruby accessing
|
|
556
|
+
variable 'b' which has value:
|
|
552
557
|
```{rb puts b}
|
|
553
558
|
```
|
|
554
559
|
and is followed by some other text!
|
|
@@ -1337,7 +1342,7 @@ module Find
|
|
|
1337
1342
|
# Skips the current file or directory, restarting the loop with the next
|
|
1338
1343
|
# entry. If the current file is a directory, that directory will not be
|
|
1339
1344
|
# recursively entered. Meaningful only within the block associated with
|
|
1340
|
-
# Find
|
|
1345
|
+
# Find::find.
|
|
1341
1346
|
#
|
|
1342
1347
|
# See the +Find+ module documentation for an example.
|
|
1343
1348
|
#
|
|
@@ -1361,7 +1366,7 @@ the Yaml header to generate this blog in PDF format instead of HTML:
|
|
|
1361
1366
|
|
|
1362
1367
|
```
|
|
1363
1368
|
---
|
|
1364
|
-
title: "gKnit - Ruby and R Knitting with Galaaz
|
|
1369
|
+
title: "gKnit - Ruby and R Knitting with Galaaz"
|
|
1365
1370
|
author: "Rodrigo Botafogo"
|
|
1366
1371
|
tags: [Galaaz, Ruby, R, JRuby, CRuby, "GNU R", knitr, gknit]
|
|
1367
1372
|
date: "29 October 2018"
|