diff --git a/docs/examples/UserGuide/conditionals.jl b/docs/examples/UserGuide/conditionals.jl index 604a7fd..b1d6059 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. diff --git a/docs/examples/UserGuide/slice.jl b/docs/examples/UserGuide/slice.jl index 03ceadd..db348fe 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 diff --git a/src/docstrings.jl b/src/docstrings.jl index a53788a..f6d76fd 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 +"""