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" 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)