From 239674f5dc9c52f7d6ad9be8c8850e06caeb12c9 Mon Sep 17 00:00:00 2001 From: Glen Hertz Date: Mon, 15 Apr 2024 13:53:45 -0400 Subject: [PATCH 1/7] fix(slice docs): slice_sample(n=5) The docs have `slice_sample(5)` which only creates one sample (not 5). Perhaps this is a code issue and not a doc issue. --- docs/examples/UserGuide/slice.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/examples/UserGuide/slice.jl b/docs/examples/UserGuide/slice.jl index a3741983..a8ac893e 100644 --- a/docs/examples/UserGuide/slice.jl +++ b/docs/examples/UserGuide/slice.jl @@ -64,7 +64,7 @@ end # ## Sample 5 random rows in the data frame @chain df begin - @slice_sample(5) + @slice_sample(n=5) end # ## Slice the min @@ -99,4 +99,4 @@ end @chain df begin @slice_head(n = 3) -end \ No newline at end of file +end From d6210bc6b8ef62f073d90cf0b31121f3359fe4dd Mon Sep 17 00:00:00 2001 From: Glen Hertz Date: Mon, 15 Apr 2024 14:27:26 -0400 Subject: [PATCH 2/7] Fix typo in conditionals.jl docs --- docs/examples/UserGuide/conditionals.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/examples/UserGuide/conditionals.jl b/docs/examples/UserGuide/conditionals.jl index 604a7fd2..b1d6059f 100644 --- a/docs/examples/UserGuide/conditionals.jl +++ b/docs/examples/UserGuide/conditionals.jl @@ -34,7 +34,7 @@ end # Although `if_else()` is convenient when evaluating a single condition, it can be cumbersome when evaluating multiple conditions because subsequent conditions need to be nested within the `no` condition for the preceding argument. For situations where multiple conditions need to be evaluated, `case_when()` is more convenient. -# Let's first consider a similar example from above and recreate it using `case_when()`. The following code creates a column `b` that assigns a value if 3 if `a >= 3` and otherwise leaves the value unchanged. +# Let's first consider a similar example from above and recreate it using `case_when()`. The following code creates a column `b` that assigns a value of 3 if `a >= 3` and otherwise leaves the value unchanged. @chain df begin @mutate(b = case_when(a >= 3 => 3, @@ -72,4 +72,4 @@ end # ## Do these functions work outside of TidierData.jl? -# Yes, both `if_else()` and `case_when()` work outside of TidierData.jl. However, you'll need to remember that if working with vectors, both the functions and conditions will need to be vectorized, and in the case of `case_when()`, the `=>` will need to be written as `.=>`. The reason this is not needed when using these functions inside of TidierData.jl is because they are auto-vectorized. \ No newline at end of file +# Yes, both `if_else()` and `case_when()` work outside of TidierData.jl. However, you'll need to remember that if working with vectors, both the functions and conditions will need to be vectorized, and in the case of `case_when()`, the `=>` will need to be written as `.=>`. The reason this is not needed when using these functions inside of TidierData.jl is because they are auto-vectorized. From bfcf9e083aeb74044f72fa11231e34704f5f61a8 Mon Sep 17 00:00:00 2001 From: Glen Hertz Date: Sat, 20 Apr 2024 17:02:58 -0400 Subject: [PATCH 3/7] Add docs for `values_fill` for `pivot_wider` --- src/docstrings.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/docstrings.jl b/src/docstrings.jl index a53788a8..f6d76fd3 100644 --- a/src/docstrings.jl +++ b/src/docstrings.jl @@ -1320,7 +1320,7 @@ julia> @semi_join(df1, df2, "a" = "a") const docstring_pivot_wider = """ - @pivot_wider(df, names_from, values_from) + @pivot_wider(df, names_from, values_from[, values_fill]) Reshapes the DataFrame to make it wider, increasing the number of columns and reducing the number of rows. @@ -1328,6 +1328,7 @@ Reshapes the DataFrame to make it wider, increasing the number of columns and re - `df`: A DataFrame. - `names_from`: The name of the column to get the name of the output columns from. - `values_from`: The name of the column to get the cell values from. +- `values_fill`: The value to replace a missing name/value combination (default is `missing`) # Examples ```jldoctest @@ -3409,4 +3410,4 @@ julia> @relocate(df, B:C) # bring columns to the front 4 │ 9 D 4 B 4 D 5 │ 10 E 5 C 5 E ``` -""" \ No newline at end of file +""" From 7203e0cf3d3045f8fcbe0bf92e9c41190abbaadd Mon Sep 17 00:00:00 2001 From: Glen Hertz Date: Mon, 15 Apr 2024 13:53:45 -0400 Subject: [PATCH 4/7] fix(slice docs): slice_sample(n=5) The docs have `slice_sample(5)` which only creates one sample (not 5). Perhaps this is a code issue and not a doc issue. --- docs/examples/UserGuide/slice.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/UserGuide/slice.jl b/docs/examples/UserGuide/slice.jl index 03ceadd2..db348fea 100644 --- a/docs/examples/UserGuide/slice.jl +++ b/docs/examples/UserGuide/slice.jl @@ -99,4 +99,4 @@ end @chain df begin @slice_head(n = 3) -end \ No newline at end of file +end From 9464368e3efe52c0a5868df66c1a99616a21eb65 Mon Sep 17 00:00:00 2001 From: Glen Hertz Date: Mon, 15 Apr 2024 14:27:26 -0400 Subject: [PATCH 5/7] Fix typo in conditionals.jl docs --- docs/examples/UserGuide/conditionals.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/examples/UserGuide/conditionals.jl b/docs/examples/UserGuide/conditionals.jl index 604a7fd2..b1d6059f 100644 --- a/docs/examples/UserGuide/conditionals.jl +++ b/docs/examples/UserGuide/conditionals.jl @@ -34,7 +34,7 @@ end # Although `if_else()` is convenient when evaluating a single condition, it can be cumbersome when evaluating multiple conditions because subsequent conditions need to be nested within the `no` condition for the preceding argument. For situations where multiple conditions need to be evaluated, `case_when()` is more convenient. -# Let's first consider a similar example from above and recreate it using `case_when()`. The following code creates a column `b` that assigns a value if 3 if `a >= 3` and otherwise leaves the value unchanged. +# Let's first consider a similar example from above and recreate it using `case_when()`. The following code creates a column `b` that assigns a value of 3 if `a >= 3` and otherwise leaves the value unchanged. @chain df begin @mutate(b = case_when(a >= 3 => 3, @@ -72,4 +72,4 @@ end # ## Do these functions work outside of TidierData.jl? -# Yes, both `if_else()` and `case_when()` work outside of TidierData.jl. However, you'll need to remember that if working with vectors, both the functions and conditions will need to be vectorized, and in the case of `case_when()`, the `=>` will need to be written as `.=>`. The reason this is not needed when using these functions inside of TidierData.jl is because they are auto-vectorized. \ No newline at end of file +# Yes, both `if_else()` and `case_when()` work outside of TidierData.jl. However, you'll need to remember that if working with vectors, both the functions and conditions will need to be vectorized, and in the case of `case_when()`, the `=>` will need to be written as `.=>`. The reason this is not needed when using these functions inside of TidierData.jl is because they are auto-vectorized. From 779fc7c46c885813d576e296eb8630b9532d233a Mon Sep 17 00:00:00 2001 From: Glen Hertz Date: Sat, 20 Apr 2024 17:02:58 -0400 Subject: [PATCH 6/7] Add docs for `values_fill` for `pivot_wider` --- src/docstrings.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/docstrings.jl b/src/docstrings.jl index a53788a8..f6d76fd3 100644 --- a/src/docstrings.jl +++ b/src/docstrings.jl @@ -1320,7 +1320,7 @@ julia> @semi_join(df1, df2, "a" = "a") const docstring_pivot_wider = """ - @pivot_wider(df, names_from, values_from) + @pivot_wider(df, names_from, values_from[, values_fill]) Reshapes the DataFrame to make it wider, increasing the number of columns and reducing the number of rows. @@ -1328,6 +1328,7 @@ Reshapes the DataFrame to make it wider, increasing the number of columns and re - `df`: A DataFrame. - `names_from`: The name of the column to get the name of the output columns from. - `values_from`: The name of the column to get the cell values from. +- `values_fill`: The value to replace a missing name/value combination (default is `missing`) # Examples ```jldoctest @@ -3409,4 +3410,4 @@ julia> @relocate(df, B:C) # bring columns to the front 4 │ 9 D 4 B 4 D 5 │ 10 E 5 C 5 E ``` -""" \ No newline at end of file +""" From 74ea2a2d5d04291e8395951a94820abbdac8f02e Mon Sep 17 00:00:00 2001 From: Karandeep Singh Date: Sat, 8 Jun 2024 01:39:32 -0400 Subject: [PATCH 7/7] Fixed typo in conditionals.jl documentation. --- docs/examples/UserGuide/conditionals.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/UserGuide/conditionals.jl b/docs/examples/UserGuide/conditionals.jl index b1d6059f..38c915b0 100644 --- a/docs/examples/UserGuide/conditionals.jl +++ b/docs/examples/UserGuide/conditionals.jl @@ -72,4 +72,4 @@ end # ## Do these functions work outside of TidierData.jl? -# Yes, both `if_else()` and `case_when()` work outside of TidierData.jl. However, you'll need to remember that if working with vectors, both the functions and conditions will need to be vectorized, and in the case of `case_when()`, the `=>` will need to be written as `.=>`. The reason this is not needed when using these functions inside of TidierData.jl is because they are auto-vectorized. +# Yes, both `if_else()` and `case_when()` work outside of TidierData.jl. However, you'll need to remember that if working with vectors, both the functions and conditions will need to be vectorized, and in the case of `case_when()`, the `=>` will need to be written as `.=>`. The reason this is not needed when using these functions inside of TidierData.jl is because they are auto-vectorized. \ No newline at end of file