Skip to content

Commit

Permalink
Merge pull request #110 from codedthinking/0.4-bugfixes
Browse files Browse the repository at this point in the history
Use repl blocks in docs
  • Loading branch information
korenmiklos authored Jul 3, 2024
2 parents 457c041 + 21dd0d9 commit 53e8654
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Kezdi"
uuid = "48308a23-c29e-446c-b4c0-d9446a767439"
authors = ["Miklos Koren <[email protected]>", "Gergely Attila Kiss <[email protected]>"]
version = "0.4.0"
version = "0.4.1"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down
16 changes: 8 additions & 8 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 53e8654

Please sign in to comment.