From 061d827f6587c13379ec78cc1eda04ca954b49bd Mon Sep 17 00:00:00 2001 From: Karandeep Singh Date: Sun, 30 Apr 2023 01:29:28 -0400 Subject: [PATCH] Minor documentation fix to convert comments to markdown. --- docs/examples/UserGuide/filter.jl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/examples/UserGuide/filter.jl b/docs/examples/UserGuide/filter.jl index f80e95d..4c29173 100644 --- a/docs/examples/UserGuide/filter.jl +++ b/docs/examples/UserGuide/filter.jl @@ -5,7 +5,7 @@ using RDatasets movies = dataset("ggplot2", "movies"); -# Let’s take a look at the movies whose budget was more than average. We will select only the first 5 rows for the sake of brevity. +# ## Let’s take a look at the movies whose budget was more than average. We will select only the first 5 rows for the sake of brevity. @chain movies begin @mutate(Budget = Budget / 1_000_000) @@ -14,9 +14,9 @@ movies = dataset("ggplot2", "movies"); @slice(1:5) end -# Let's search for movies that have at least 200 votes and a rating of greater than or equal to 8. There are 3 ways you can specify an "and" condition inside of `Tidier.jl`. +# ## Let's search for movies that have at least 200 votes and a rating of greater than or equal to 8. There are 3 ways you can specify an "and" condition inside of `Tidier.jl`. -## The first option is to use the short-circuiting `&&` operator as shown below. This is the preferred approach because the second expression is only evaluated (per element) if the first one is true. +# ### The first option is to use the short-circuiting `&&` operator as shown below. This is the preferred approach because the second expression is only evaluated (per element) if the first one is true. @chain movies begin @filter(Votes >= 200 && Rating >= 8) @@ -24,7 +24,7 @@ end @slice(1:5) end -## The second option is to use the bitwise `&` operator. However, there is a key difference in syntax. Because the `&` operator takes a higher operator precendence than `>=`, you have to wrap the `>=` expressions inside of parentheses to ensure that the expression is evaluated correctly. +# ### The second option is to use the bitwise `&` operator. Note that there is a key difference in syntax between `&` and `&&`. Because the `&` operator takes a higher operator precendence than `>=`, you have to wrap the comparison expressions inside of parentheses to ensure that the overall expression is evaluated correctly. @chain movies begin @filter((Votes >= 200) & (Rating >= 8)) @@ -32,7 +32,7 @@ end @slice(1:5) end -## Finally, for "and" conditions only, you can separate the expressions with commas, similar to the behavior of `filter()` in `tidyverse`. +# ### The third option for "and" conditions only is to separate the expressions with commas. This is similar to the behavior of `filter()` in `tidyverse`. @chain movies begin @filter(Votes >= 200, Rating >= 8) @@ -40,7 +40,7 @@ end @slice(1:5) end -# Now let's see how to use `@filter()` with `in`. Here's an example with a tuple. +# ## Now let's see how to use `@filter()` with `in`. Here's an example with a tuple. @chain movies begin @filter(Title in ("101 Dalmatians", @@ -48,7 +48,7 @@ end @select(1:5) end -# We can also use `@filter()` with `in` using a vector, denoted by a `[]`. +# ## We can also use `@filter()` with `in` using a vector, denoted by a `[]`. @chain movies begin @filter(Title in ["101 Dalmatians", @@ -56,7 +56,7 @@ end @select(1:5) end -# Finally, we can combine `@filter` with `row_number()` to retrieve the first 5 rows, which can be used to mimic the functionality provided by `@slice`. +# ## Finally, we can combine `@filter` with `row_number()` to retrieve the first 5 rows, which can be used to mimic the functionality provided by `@slice`. @chain movies begin @filter(row_number() <= 5)