From ff0311a5c970b03b92c718b29bd1d5d107bf65a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Koren?= Date: Wed, 3 Jul 2024 18:55:05 +0200 Subject: [PATCH 1/2] Use repl blocks in docs @JuliaRegistrator register() --- docs/src/index.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/src/index.md b/docs/src/index.md index 5f2bc90..911c48f 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -24,11 +24,14 @@ using Pkg; Pkg.add(url="https://github.com/codedthinking/Kezdi.jl") Every Kezdi.jl command is a macro that begins with `@`. These commands operate on a global `DataFrame` that is set using the `setdf` function. Alternatively, commands can be executed within a `@with` block that sets the `DataFrame` for the duration of the block. ### Example -```julia +```@setup mtcars using Kezdi using RDatasets -setdf(dataset("datasets", "mtcars")) +df = dataset("datasets", "mtcars") +``` +```@repl mtcars +setdf(df) @rename HP Horsepower @rename Disp Displacement @@ -43,12 +46,7 @@ setdf(dataset("datasets", "mtcars")) ``` Alternatively, you can use the `@with` block to avoid writing to a global `DataFrame`: -```julia -using Kezdi -using RDatasets - -df = dataset("datasets", "mtcars") - +```@repl mtcars renamed_df = @with df begin @rename HP Horsepower @rename Disp Displacement @@ -77,6 +75,8 @@ end | `@summarize` | 10.40s | 0.58s | 0.37s | 28x | | `@regress` | 0.89s | 1.93s | 0.16s | 6x | +See the benchmarking code for [Stata](https://github.com/codedthinking/Kezdi.jl/blob/main/examples/benchmark.do) and [Kezdi.jl](https://github.com/codedthinking/Kezdi.jl/blob/main/examples/benchmark.jl). + ### Use any Julia function ```julia @generate logHP = log(Horsepower) From 21dd0d9d9f4b1a271c1457394c77188c225ba42c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Koren?= Date: Wed, 3 Jul 2024 18:59:08 +0200 Subject: [PATCH 2/2] Bump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index bff5e93..d90b741 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Kezdi" uuid = "48308a23-c29e-446c-b4c0-d9446a767439" authors = ["Miklos Koren ", "Gergely Attila Kiss "] -version = "0.4.0" +version = "0.4.1" [deps] CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"