diff --git a/404.html b/404.html index ad56b11..60c8947 100644 --- a/404.html +++ b/404.html @@ -20,7 +20,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html index e461779..1db7820 100644 --- a/CODE_OF_CONDUCT.html +++ b/CODE_OF_CONDUCT.html @@ -7,7 +7,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/LICENSE-text.html b/LICENSE-text.html index 69441f9..394e204 100644 --- a/LICENSE-text.html +++ b/LICENSE-text.html @@ -7,7 +7,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/LICENSE.html b/LICENSE.html index b520c1d..5085733 100644 --- a/LICENSE.html +++ b/LICENSE.html @@ -7,7 +7,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/authors.html b/authors.html index 97fbb38..d74a1db 100644 --- a/authors.html +++ b/authors.html @@ -7,7 +7,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 @@ -54,13 +54,13 @@ Citation Thorley J (2024). tidyplus: Additional 'tidyverse' Functions. -R package version 0.1.0.9001, https://github.com/poissonconsulting/tidyplus, https://poissonconsulting.github.io/tidyplus/. +R package version 0.1.0.9002, https://github.com/poissonconsulting/tidyplus, https://poissonconsulting.github.io/tidyplus/. @Manual{, title = {tidyplus: Additional 'tidyverse' Functions}, author = {Joe Thorley}, year = {2024}, - note = {R package version 0.1.0.9001, https://github.com/poissonconsulting/tidyplus}, + note = {R package version 0.1.0.9002, https://github.com/poissonconsulting/tidyplus}, url = {https://poissonconsulting.github.io/tidyplus/}, } diff --git a/index.html b/index.html index 93d0fe8..feed40e 100644 --- a/index.html +++ b/index.html @@ -22,7 +22,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/news/index.html b/news/index.html index ffe1c5e..cea1c49 100644 --- a/news/index.html +++ b/news/index.html @@ -7,7 +7,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 @@ -32,6 +32,10 @@ Changelog Source: NEWS.md + +tidyplus 0.1.0.9002 +Added informative error message to if_else2() if no matches are found + tidyplus 0.1.0.9001 Internal changes. diff --git a/pkgdown.yml b/pkgdown.yml index 1f45883..c2d5c53 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -2,7 +2,7 @@ pandoc: 3.1.11 pkgdown: 2.1.1 pkgdown_sha: ~ articles: {} -last_built: 2024-10-31T00:04Z +last_built: 2024-10-31T00:06Z urls: reference: https://poissonconsulting.github.io/tidyplus/reference article: https://poissonconsulting.github.io/tidyplus/articles diff --git a/reference/add_missing_column.html b/reference/add_missing_column.html index 8d0a12b..bc00bb4 100644 --- a/reference/add_missing_column.html +++ b/reference/add_missing_column.html @@ -11,7 +11,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/reference/coalesce_data.html b/reference/coalesce_data.html index b3a53d6..a791d8f 100644 --- a/reference/coalesce_data.html +++ b/reference/coalesce_data.html @@ -11,7 +11,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/reference/collapse_comments.html b/reference/collapse_comments.html index 97de270..12c805e 100644 --- a/reference/collapse_comments.html +++ b/reference/collapse_comments.html @@ -9,7 +9,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/reference/drop_na_all.html b/reference/drop_na_all.html index 2043abe..6ec7325 100644 --- a/reference/drop_na_all.html +++ b/reference/drop_na_all.html @@ -7,7 +7,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/reference/drop_uninformative_columns.html b/reference/drop_uninformative_columns.html index 4244d54..56e91f0 100644 --- a/reference/drop_uninformative_columns.html +++ b/reference/drop_uninformative_columns.html @@ -9,7 +9,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/reference/duplicates.html b/reference/duplicates.html index d8327f2..429673a 100644 --- a/reference/duplicates.html +++ b/reference/duplicates.html @@ -7,7 +7,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/reference/if_else2.html b/reference/if_else2.html index 51bc972..f4f97c3 100644 --- a/reference/if_else2.html +++ b/reference/if_else2.html @@ -13,7 +13,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/reference/index.html b/reference/index.html index 229b4b8..3b36114 100644 --- a/reference/index.html +++ b/reference/index.html @@ -7,7 +7,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/reference/only.html b/reference/only.html index d853512..38bf410 100644 --- a/reference/only.html +++ b/reference/only.html @@ -9,7 +9,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/reference/replace_na_if.html b/reference/replace_na_if.html index 41ad541..5001f21 100644 --- a/reference/replace_na_if.html +++ b/reference/replace_na_if.html @@ -7,7 +7,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/reference/str_crush.html b/reference/str_crush.html index 8f2e80c..3566875 100644 --- a/reference/str_crush.html +++ b/reference/str_crush.html @@ -9,7 +9,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/reference/str_detect2.html b/reference/str_detect2.html index 981fbe8..d4bd207 100644 --- a/reference/str_detect2.html +++ b/reference/str_detect2.html @@ -15,7 +15,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/reference/str_replace_vec.html b/reference/str_replace_vec.html index 134b8c0..5eba125 100644 --- a/reference/str_replace_vec.html +++ b/reference/str_replace_vec.html @@ -7,7 +7,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/reference/str_to_snake_case.html b/reference/str_to_snake_case.html index 5d04391..9be7713 100644 --- a/reference/str_to_snake_case.html +++ b/reference/str_to_snake_case.html @@ -7,7 +7,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/reference/summarise2.html b/reference/summarise2.html index b2acfae..578cb01 100644 --- a/reference/summarise2.html +++ b/reference/summarise2.html @@ -11,7 +11,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/reference/tidyplus-package.html b/reference/tidyplus-package.html index f489f34..9866205 100644 --- a/reference/tidyplus-package.html +++ b/reference/tidyplus-package.html @@ -7,7 +7,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/reference/unite_str.html b/reference/unite_str.html index df8d752..844d5a5 100644 --- a/reference/unite_str.html +++ b/reference/unite_str.html @@ -7,7 +7,7 @@ tidyplus - 0.1.0.9001 + 0.1.0.9002 diff --git a/search.json b/search.json index d25706a..c5bf009 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement .github/. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.0, available https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2022 Poisson Consulting Ltd. Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Joe Thorley. Author. Ayla Pearson. Maintainer. Poisson Consulting. Copyright holder, funder.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Thorley J (2024). tidyplus: Additional 'tidyverse' Functions. R package version 0.1.0.9001, https://github.com/poissonconsulting/tidyplus, https://poissonconsulting.github.io/tidyplus/.","code":"@Manual{, title = {tidyplus: Additional 'tidyverse' Functions}, author = {Joe Thorley}, year = {2024}, note = {R package version 0.1.0.9001, https://github.com/poissonconsulting/tidyplus}, url = {https://poissonconsulting.github.io/tidyplus/}, }"},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/index.html","id":"introduction","dir":"","previous_headings":"","what":"Introduction","title":"Additional tidyverse Functions","text":"tidyplus provides functions str_crush(), add_missing_column(), coalesce_data() drop_na_all() complement ‘tidyverse’ functionality functions provide alternative behaviors if_else2() str_detect2().","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Additional tidyverse Functions","text":"can install development version tidyplus GitHub :","code":"# install.packages(\"devtools\") devtools::install_github(\"poissonconsulting/tidyplus\")"},{"path":"https://poissonconsulting.github.io/tidyplus/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Additional tidyverse Functions","text":"Please note tidyplus project released Contributor Code Conduct. contributing project, agree abide terms.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/add_missing_column.html","id":null,"dir":"Reference","previous_headings":"","what":"Add missing columns to a data frame — add_missing_column","title":"Add missing columns to a data frame — add_missing_column","text":"convenient way add one columns (already present) existing data frame. useful ensure required columns present data frame.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/add_missing_column.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add missing columns to a data frame — add_missing_column","text":"","code":"add_missing_column( .data, ..., .before = NULL, .after = NULL, .name_repair = c(\"check_unique\", \"unique\", \"universal\", \"minimal\") )"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/add_missing_column.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add missing columns to a data frame — add_missing_column","text":".data Data frame append . ... Name-value pairs, passed tibble(). values must size .data size 1. ., .One-based column index column name add new columns, default: last column. .name_repair Treatment problematic column names: \"minimal\": name repair checks, beyond basic existence, \"unique\": Make sure names unique empty, \"check_unique\": (default value), name repair, check unique, \"universal\": Make names unique syntactic function: apply custom name repair (e.g., .name_repair = make.names names style base R). purrr-style anonymous function, see rlang::as_function() argument passed repair vctrs::vec_as_names(). See details terms strategies used enforce .","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/add_missing_column.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add missing columns to a data frame — add_missing_column","text":"original data frame missing columns added already present.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/add_missing_column.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add missing columns to a data frame — add_missing_column","text":"wrapper tibble::add_column() error column already present.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/add_missing_column.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add missing columns to a data frame — add_missing_column","text":"","code":"data <- tibble::tibble(x = 1:3, y = 3:1) tibble::add_column(data, z = -1:1, w = 0) #> # A tibble: 3 × 4 #> x y z w #> #> 1 1 3 -1 0 #> 2 2 2 0 0 #> 3 3 1 1 0 add_missing_column(data, z = -1:1, .before = \"y\") #> # A tibble: 3 × 3 #> x z y #> #> 1 1 -1 3 #> 2 2 0 2 #> 3 3 1 1 # add_column errors if already present try(tibble::add_column(data, x = 4:6)) #> Error in tibble::add_column(data, x = 4:6) : #> Column name `x` must not be duplicated. #> Use `.name_repair` to specify repair. #> Caused by error in `repaired_names()`: #> ! Names must be unique. #> ✖ These names are duplicated: #> * \"x\" at locations 1 and 3. # add_missing_column silently ignores add_missing_column(data, x = 4:6) #> # A tibble: 3 × 2 #> x y #> #> 1 1 3 #> 2 2 2 #> 3 3 1"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/coalesce_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Coalesce Data — coalesce_data","title":"Coalesce Data — coalesce_data","text":"Coalesce values multiple columns finding first non-missing value position. Coalesced columns removed.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/coalesce_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Coalesce Data — coalesce_data","text":"","code":"coalesce_data(x, coalesce = list(), quiet = FALSE)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/coalesce_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Coalesce Data — coalesce_data","text":"x data frame. coalesce uniquely named list character vectors names new column names values names columns coalesce. single value provided column treated regular expression. quiet flag specifying whether provide messages.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/coalesce_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Coalesce Data — coalesce_data","text":"original data frame one columns coalesced new column.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/coalesce_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Coalesce Data — coalesce_data","text":"Coalescence performed order specified coalesce argument column produced coalescence can coalesced.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/coalesce_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Coalesce Data — coalesce_data","text":"","code":"data <- data.frame(x = c(1, NA, NA), y = c(NA, 3, NA), z = c(7, 8, 9), a = c(4, 5, 6)) coalesce_data(data, list(b = c(\"x\", \"y\")), quiet = TRUE) #> z a b #> 1 7 4 1 #> 2 8 5 3 #> 3 9 6 NA coalesce_data(data, list(z = c(\"y\", \"x\"), d = c(\"z\", \"a\"))) #> Coalesced 'z' from: 'y' and 'x' #> Coalesced 'd' from: 'z' and 'a' #> d #> 1 1 #> 2 3 #> 3 6"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/collapse_comments.html","id":null,"dir":"Reference","previous_headings":"","what":"Collapse Comments — collapse_comments","title":"Collapse Comments — collapse_comments","text":"Collapse comments coercing element string (character scalar) collapsing single string using '. ' separator.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/collapse_comments.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Collapse Comments — collapse_comments","text":"","code":"collapse_comments(...)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/collapse_comments.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collapse Comments — collapse_comments","text":"... objects collapsed string.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/collapse_comments.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Collapse Comments — collapse_comments","text":"string collapsed comments.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/collapse_comments.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Collapse Comments — collapse_comments","text":"","code":"collapse_comments(\"Saw fish\", character(0), \"Nice. .\", NA_character_) #> [1] \"Saw fish. Nice.\" data <- data.frame( visit = c(1, 1, 2, 2), fish = 1:4, comment = c(\"Sunny day. \", \"Skinny fish\", \"Lost boot\", NA) ) if (FALSE) { # \\dontrun{ data |> dplyr::group_by(visit) |> dplyr::summarise(comment = collapse_comments(comment)) |> dplyr::ungroup() } # }"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_na_all.html","id":null,"dir":"Reference","previous_headings":"","what":"Drop rows containing all missing values — drop_na_all","title":"Drop rows containing all missing values — drop_na_all","text":"convenient way drop uninformative rows data frame.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_na_all.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Drop rows containing all missing values — drop_na_all","text":"","code":"drop_na_all(data, ...)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_na_all.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Drop rows containing all missing values — drop_na_all","text":"data data frame. ... Columns inspect missing values. empty, columns used.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_na_all.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Drop rows containing all missing values — drop_na_all","text":"original data frame rows values missing dropped.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_na_all.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Drop rows containing all missing values — drop_na_all","text":"","code":"data <- tibble::tibble( a = c(NA, NA, NA), b = c(1, 1, NA), c = c(2, NA, NA) ) drop_na_all(data) #> # A tibble: 2 × 3 #> a b c #> #> 1 NA 1 2 #> 2 NA 1 NA drop_na_all(data, a, c) #> # A tibble: 1 × 3 #> a b c #> #> 1 NA 1 2"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_uninformative_columns.html","id":null,"dir":"Reference","previous_headings":"","what":"Drop uninformative columns from a data frame — drop_uninformative_columns","title":"Drop uninformative columns from a data frame — drop_uninformative_columns","text":"convenient way drop columns one value (missing ) na_distinct = FALSE also drop columns one value /missing values.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_uninformative_columns.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Drop uninformative columns from a data frame — drop_uninformative_columns","text":"","code":"drop_uninformative_columns(data, na_distinct = TRUE)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_uninformative_columns.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Drop uninformative columns from a data frame — drop_uninformative_columns","text":"data data frame. na_distinct flag specifying whether treat missing values distinct values.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_uninformative_columns.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Drop uninformative columns from a data frame — drop_uninformative_columns","text":"original data frame informative columns.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_uninformative_columns.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Drop uninformative columns from a data frame — drop_uninformative_columns","text":"","code":"data <- tibble::tibble( a = c(1, 1, 1), x = c(NA, NA, NA), b = c(1, 1, NA), z = c(1, 2, 2), e = c(1, 2, NA) ) drop_uninformative_columns(data) #> # A tibble: 3 × 3 #> b z e #> #> 1 1 1 1 #> 2 1 2 2 #> 3 NA 2 NA drop_uninformative_columns(data, na_distinct = FALSE) #> # A tibble: 3 × 2 #> z e #> #> 1 1 1 #> 2 2 2 #> 3 2 NA"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/duplicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Keep non-unique rows in a data frame — duplicates","title":"Keep non-unique rows in a data frame — duplicates","text":"Keeps non-unique rows within data frame.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/duplicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Keep non-unique rows in a data frame — duplicates","text":"","code":"duplicates(.data, ..., .keep_all = TRUE)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/duplicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Keep non-unique rows in a data frame — duplicates","text":".data data.frame. ... Optional variables use determining non-uniqueness. omitted, use variables data frame. .keep_all flag specifying whether keep variables .data.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/duplicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Keep non-unique rows in a data frame — duplicates","text":"original data frame non-unique rows.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/duplicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Keep non-unique rows in a data frame — duplicates","text":"","code":"data <- tibble::tibble(x = c(1, 2, 1, 1), y = c(1, 1, 1, 5)) duplicates(data) #> # A tibble: 2 × 2 #> x y #> #> 1 1 1 #> 2 1 1 duplicates(data, x) #> # A tibble: 3 × 2 #> x y #> #> 1 1 1 #> 2 1 1 #> 3 1 5 duplicates(data, y) #> # A tibble: 3 × 2 #> x y #> #> 1 1 1 #> 2 2 1 #> 3 1 1 duplicates(data, x, y) #> # A tibble: 2 × 2 #> x y #> #> 1 1 1 #> 2 1 1 duplicates(data, y, .keep_all = FALSE) #> # A tibble: 3 × 1 #> y #> #> 1 1 #> 2 1 #> 3 1"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/if_else2.html","id":null,"dir":"Reference","previous_headings":"","what":"Vectorised if else. — if_else2","title":"Vectorised if else. — if_else2","text":"Vectorised else true returns first possibility otherwise returns second possibility (even condition missing value). searching character vectors alternative solution use str_detect2().","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/if_else2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Vectorised if else. — if_else2","text":"","code":"if_else2(condition, true, false)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/if_else2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Vectorised if else. — if_else2","text":"condition logical vector true, false Vectors use TRUE FALSE values condition. true false recycled size condition. true, false, missing (used) cast common type.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/if_else2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Vectorised if else. — if_else2","text":"condition TRUE, matching value true, FALSE NA, matching value false.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/if_else2.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Vectorised if else. — if_else2","text":"","code":"# consider the following data frame data <- tibble::tibble( x = c(TRUE, FALSE, NA), y = c(\"x is false\", NA, \"hello\") ) # with a single vector if_else2() behaves the same as the default call to if_else(). dplyr::mutate(data, y1 = dplyr::if_else(y != \"x is false\", \"x is true\", y), y2 = if_else2(y != \"x is false\", \"x is true\", y) ) #> # A tibble: 3 × 4 #> x y y1 y2 #> #> 1 TRUE x is false x is false x is false #> 2 FALSE NA NA NA #> 3 NA hello x is true x is true # however in the case of a second vector the use of # if_else2() does not introduce missing values dplyr::mutate(data, x1 = dplyr::if_else(stringr::str_detect(y, \"x is false\"), FALSE, x), x2 = if_else2(stringr::str_detect(y, \"x is false\"), FALSE, x) ) #> # A tibble: 3 × 4 #> x y x1 x2 #> #> 1 TRUE x is false FALSE FALSE #> 2 FALSE NA NA FALSE #> 3 NA hello NA NA # in the case of regular expression matching an alternative is to use # str_detect2() dplyr::mutate(data, x3 = dplyr::if_else(str_detect2(y, \"x is false\"), FALSE, x) ) #> # A tibble: 3 × 3 #> x y x3 #> #> 1 TRUE x is false FALSE #> 2 FALSE NA FALSE #> 3 NA hello NA"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/only.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract the only distinct value from a vector — only","title":"Extract the only distinct value from a vector — only","text":"Extracts distinct value atomic vector throws informative error values multiple distinct values.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/only.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract the only distinct value from a vector — only","text":"","code":"only(x, na_rm = FALSE)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/only.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract the only distinct value from a vector — only","text":"x atomic vector. na_rm flag indicating whether exclude missing values.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/only.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract the only distinct value from a vector — only","text":"distinct value vector otherwise throws error.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/only.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Extract the only distinct value from a vector — only","text":"() useful summarizing vector group checking assumption constant within group.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/only.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract the only distinct value from a vector — only","text":"","code":"only(c(1, 1)) #> [1] 1 only(c(NA, NA)) #> [1] NA only(c(1, 1, NA), na_rm = TRUE) #> [1] 1 try(only(character(0))) #> Error in only(character(0)) : `x` must have at least 1 element. try(only(c(1, NA))) #> Error in only(c(1, NA)) : `x` must only have 1 distinct value. try(only(c(1, 2))) #> Error in only(c(1, 2)) : `x` must only have 1 distinct value."},{"path":"https://poissonconsulting.github.io/tidyplus/reference/replace_na_if.html","id":null,"dir":"Reference","previous_headings":"","what":"Conditional replacement of NAs with specified values — replace_na_if","title":"Conditional replacement of NAs with specified values — replace_na_if","text":"Unlike tidyr::replace_na(), defined vectors.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/replace_na_if.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Conditional replacement of NAs with specified values — replace_na_if","text":"","code":"replace_na_if(x, condition, true)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/replace_na_if.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Conditional replacement of NAs with specified values — replace_na_if","text":"x Vector missing values modify. condition logical vector true replacement values condition TRUE.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/replace_na_if.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Conditional replacement of NAs with specified values — replace_na_if","text":"modified version x replaces missing values condition TRUE true.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/replace_na_if.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Conditional replacement of NAs with specified values — replace_na_if","text":"replace_na_if() wrapper if_else2(.na(x) & condition, true, x)","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/replace_na_if.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Conditional replacement of NAs with specified values — replace_na_if","text":"","code":"data <- tibble::tibble( x = c(TRUE, FALSE, NA), y = c(\"x is false\", NA, \"x is false\") ) dplyr::mutate(data, x1 = tidyr::replace_na(x, FALSE), x3 = if_else2(is.na(x) & y == \"x is false\", FALSE, x), x4 = replace_na_if(x, y == \"x is false\", FALSE) ) #> # A tibble: 3 × 5 #> x y x1 x3 x4 #> #> 1 TRUE x is false TRUE TRUE TRUE #> 2 FALSE NA FALSE FALSE FALSE #> 3 NA x is false FALSE FALSE FALSE"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_crush.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove whitespace from a string — str_crush","title":"Remove whitespace from a string — str_crush","text":"str_crush(), removes whitespace string, logical extension stringr::str_trim() stringr::str_squish().","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_crush.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove whitespace from a string — str_crush","text":"","code":"str_crush(string)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_crush.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove whitespace from a string — str_crush","text":"string Input vector. Either character vector, something coercible one.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_crush.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove whitespace from a string — str_crush","text":"character vector length string.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_crush.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Remove whitespace from a string — str_crush","text":"str_crush() considered specialized part stringr.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_crush.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove whitespace from a string — str_crush","text":"","code":"str_crush(\" String with trailing, middle, and leading white space\\t\") #> [1] \"Stringwithtrailing,middle,andleadingwhitespace\""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_detect2.html","id":null,"dir":"Reference","previous_headings":"","what":"Detect the presence/absence of a match — str_detect2","title":"Detect the presence/absence of a match — str_detect2","text":"Vectorised string pattern. Actually equivalent grepl(pattern, x) returns FALSE NAs (unlike stringr::str_detect()). behavior useful searching comments many NA indicate comments present.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_detect2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detect the presence/absence of a match — str_detect2","text":"","code":"str_detect2(string, pattern, negate = FALSE)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_detect2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detect the presence/absence of a match — str_detect2","text":"string Input vector. Either character vector, something coercible one. pattern Pattern look . default interpretation regular expression, described vignette(\"regular-expressions\"). Use regex() finer control matching behaviour. Match fixed string (.e. comparing bytes), using fixed(). fast, approximate. Generally, matching human text, want coll() respects character matching rules specified locale. Match character, word, line sentence boundaries boundary(). empty pattern, \"\", equivalent boundary(\"character\"). negate TRUE, inverts resulting boolean vector.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_detect2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Detect the presence/absence of a match — str_detect2","text":"logical vector length string/pattern.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_detect2.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Detect the presence/absence of a match — str_detect2","text":"","code":"x <- c(\"b\", NA, \"ab\") pattern <- \"^a\" grepl(pattern, x) #> [1] FALSE FALSE TRUE stringr::str_detect(x, pattern) #> [1] FALSE NA TRUE str_detect2(x, pattern) #> [1] FALSE FALSE TRUE"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_replace_vec.html","id":null,"dir":"Reference","previous_headings":"","what":"String replace multiple strings — str_replace_vec","title":"String replace multiple strings — str_replace_vec","text":"String replace multiple strings vector.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_replace_vec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"String replace multiple strings — str_replace_vec","text":"","code":"str_replace_vec(string, replace)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_replace_vec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"String replace multiple strings — str_replace_vec","text":"string Input vector. Either character vector, something coercible one. replace character vector names patterns look values replacement values (c(pattern1 = replacement1))","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_replace_vec.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"String replace multiple strings — str_replace_vec","text":"character vector length string/pattern/replacement.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_replace_vec.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"String replace multiple strings — str_replace_vec","text":"str_replace_vec() vectorized form stringr::str_replace(). different passing named vector stringr::str_replace_all, performs multiple replacements pattern matches string.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_replace_vec.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"String replace multiple strings — str_replace_vec","text":"","code":"fruits <- c(\"two apples\", \"nine pears\") str_replace_vec(fruits, c(\"two\" = \"three\", \"nine\" = \"ten\")) #> [1] \"three apples\" \"ten pears\""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_to_snake_case.html","id":null,"dir":"Reference","previous_headings":"","what":"Converts strings to Snake Case — str_to_snake_case","title":"Converts strings to Snake Case — str_to_snake_case","text":"Converts strings Snake Case","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_to_snake_case.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Converts strings to Snake Case — str_to_snake_case","text":"","code":"str_to_snake_case(x)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_to_snake_case.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Converts strings to Snake Case — str_to_snake_case","text":"x input string multiple strings converted snake case","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_to_snake_case.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Converts strings to Snake Case — str_to_snake_case","text":"string strings converted snake_case","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_to_snake_case.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Converts strings to Snake Case — str_to_snake_case","text":"","code":"str_to_snake_case(\"string of words\") #> [1] \"string_of_words\" str_to_snake_case(\"StringOfWords\") #> [1] \"string_of_words\" str_to_snake_case(\"s!t$ring of %char^&act*ers\") #> [1] \"string_of_characters\" str_to_snake_case(c(\"multiples of strings\", \"strings in multiple\", \"many strings\")) #> [1] \"multiples_of_strings\" \"strings_in_multiple\" \"many_strings\""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/summarise2.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarise Each Group Down to One Row — summarise2","title":"Summarise Each Group Down to One Row — summarise2","text":"Wrapper dplyr::summarise sets default .group variable \"keep\". means groups set dplyr::group_by retained, just first group.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/summarise2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarise Each Group Down to One Row — summarise2","text":"","code":"summarise2(.data, ..., .by = NULL, .groups = \"keep\") summarize2(.data, ..., .by = NULL, .groups = \"keep\")"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/summarise2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarise Each Group Down to One Row — summarise2","text":".data data frame, data frame extension (e.g. tibble), lazy data frame (e.g. dbplyr dtplyr). See Methods, , details. ... Name-value pairs summary functions. name name variable result. value can : vector length 1, e.g. min(x), n(), sum(.na(y)). data frame, add multiple columns single expression. Returning values size 0 >1 deprecated 1.1.0. Please use reframe() instead. . Optionally, selection columns group just operation, functioning alternative group_by(). details examples, see ?dplyr_by. .groups Grouping structure result. \"drop_last\": dropping last level grouping. supported option version 1.0.0. \"drop\": levels grouping dropped. \"keep\": grouping structure .data. \"rowwise\": row group. .groups specified, chosen based number rows results: results 1 row, get \"drop_last\". number rows varies, get \"keep\" (note returning variable number rows deprecated favor reframe(), also unconditionally drops levels grouping). addition, message informs choice, unless result ungrouped, option \"dplyr.summarise.inform\" set FALSE, summarise() called function package.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/summarise2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarise Each Group Down to One Row — summarise2","text":"object usually type .data. rows come underlying group_keys(). columns combination grouping keys summary expressions provide. grouping structure controlled .groups= argument, output may another grouped_df, tibble rowwise data frame. Data frame attributes preserved, summarise() fundamentally creates new data frame.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/summarise2.html","id":"useful-functions","dir":"Reference","previous_headings":"","what":"Useful functions","title":"Summarise Each Group Down to One Row — summarise2","text":"Center: mean(), median() Spread: sd(), IQR(), mad() Range: min(), max(), Position: first(), last(), nth(), Count: n(), n_distinct() Logical: (), ()","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/summarise2.html","id":"backend-variations","dir":"Reference","previous_headings":"","what":"Backend variations","title":"Summarise Each Group Down to One Row — summarise2","text":"data frame backend supports creating variable using summary. means previously created summary variables can transformed combined within summary, mutate(). However, also means summary variables names previous variables overwrite , making variables unavailable later summary variables. behaviour may supported backends. avoid unexpected results, consider using new names summary variables, especially creating multiple summaries.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/summarise2.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Summarise Each Group Down to One Row — summarise2","text":"function generic, means packages can provide implementations (methods) classes. See documentation individual methods extra arguments differences behaviour. following methods currently available loaded packages: methods found .","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/summarise2.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Summarise Each Group Down to One Row — summarise2","text":"","code":"df <- data.frame( group = c(\"A\", \"A\", \"B\", \"B\"), id = c(1, 1, 2, 2), value = c(10, 4, 20, 6) ) # summarise2 doesn't produce message about groups df |> dplyr::group_by(group, id) |> summarise2(mean = mean(value)) #> # A tibble: 2 × 3 #> # Groups: group, id [2] #> group id mean #> #> 1 A 1 7 #> 2 B 2 13 # summarise doesn't retain all the groups set in `group_by` df |> dplyr::group_by(group, id) |> dplyr::summarise(mean = mean(value)) #> `summarise()` has grouped output by 'group'. You can override using the #> `.groups` argument. #> # A tibble: 2 × 3 #> # Groups: group [2] #> group id mean #> #> 1 A 1 7 #> 2 B 2 13"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/tidyplus-package.html","id":null,"dir":"Reference","previous_headings":"","what":"tidyplus: Additional 'tidyverse' Functions — tidyplus-package","title":"tidyplus: Additional 'tidyverse' Functions — tidyplus-package","text":"Provides functions str_crush(), add_missing_column(), coalesce_data() drop_na_all() complement 'tidyverse' functionality functions provide alternative behaviors if_else2() str_detect2().","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/tidyplus-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"tidyplus: Additional 'tidyverse' Functions — tidyplus-package","text":"Maintainer: Ayla Pearson ayla@poissonconsulting.ca (ORCID) Authors: Joe Thorley joe@poissonconsulting.ca (ORCID) contributors: Poisson Consulting [copyright holder, funder]","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/unite_str.html","id":null,"dir":"Reference","previous_headings":"","what":"Unite multiple character columns into one — unite_str","title":"Unite multiple character columns into one — unite_str","text":"Convenience function combining character columns.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/unite_str.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Unite multiple character columns into one — unite_str","text":"","code":"unite_str(data, col, ..., sep = \". \", remove = TRUE)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/unite_str.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Unite multiple character columns into one — unite_str","text":"data data frame. col name new column, string symbol. argument passed expression supports quasiquotation (can unquote strings symbols). name captured expression rlang::ensym() (note kind interface symbols represent actual objects now discouraged tidyverse; support backward compatibility). ... Columns unite sep Separator use values. remove TRUE, remove input columns output data frame.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/unite_str.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Unite multiple character columns into one — unite_str","text":"original data frame one columns combined character vectors separated period.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/unite_str.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Unite multiple character columns into one — unite_str","text":"Blank values \"\" converted missing values.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/unite_str.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Unite multiple character columns into one — unite_str","text":"","code":"data <- tibble::tibble(x = c(\"good\", \"Saw fish.\", \"\", NA), y = c(\"2021\", NA, NA, NA)) # unite has poor handling of character vectors tidyr::unite(data, \"new\", x, y, remove = FALSE) #> # A tibble: 4 × 3 #> new x y #> #> 1 good_2021 \"good\" 2021 #> 2 Saw fish._NA \"Saw fish.\" NA #> 3 _NA \"\" NA #> 4 NA_NA NA NA unite_str(data, \"new\", x, y, remove = FALSE) #> # A tibble: 4 × 3 #> new x y #> #> 1 good. 2021 good 2021 #> 2 Saw fish. Saw fish. NA #> 3 NA NA NA #> 4 NA NA NA"},{"path":"https://poissonconsulting.github.io/tidyplus/news/index.html","id":"tidyplus-0109001","dir":"Changelog","previous_headings":"","what":"tidyplus 0.1.0.9001","title":"tidyplus 0.1.0.9001","text":"Internal changes.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/news/index.html","id":"tidyplus-0109000","dir":"Changelog","previous_headings":"","what":"tidyplus 0.1.0.9000","title":"tidyplus 0.1.0.9000","text":"duplicates() now preserves groups attributes “regular” “sf” data frames. Added tests duplicates().","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/news/index.html","id":"tidyplus-010","dir":"Changelog","previous_headings":"","what":"tidyplus 0.1.0","title":"tidyplus 0.1.0","text":"Added str_replace_vec() function. Added duplicates() function. Added str_to_snake_case() function. Added summarise2() function.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/news/index.html","id":"tidyplus-002","dir":"Changelog","previous_headings":"","what":"tidyplus 0.0.2","title":"tidyplus 0.0.2","text":"CRAN release: 2022-12-16 Make package compatible upcoming release dplyr 1.1.0. Added repository bug reports URLs.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/news/index.html","id":"tidyplus-001","dir":"Changelog","previous_headings":"","what":"tidyplus 0.0.1","title":"tidyplus 0.0.1","text":"CRAN release: 2022-08-29 Released CRAN release.","code":""}] +[{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement .github/. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.0, available https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2022 Poisson Consulting Ltd. Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Joe Thorley. Author. Ayla Pearson. Maintainer. Poisson Consulting. Copyright holder, funder.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Thorley J (2024). tidyplus: Additional 'tidyverse' Functions. R package version 0.1.0.9002, https://github.com/poissonconsulting/tidyplus, https://poissonconsulting.github.io/tidyplus/.","code":"@Manual{, title = {tidyplus: Additional 'tidyverse' Functions}, author = {Joe Thorley}, year = {2024}, note = {R package version 0.1.0.9002, https://github.com/poissonconsulting/tidyplus}, url = {https://poissonconsulting.github.io/tidyplus/}, }"},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/index.html","id":"introduction","dir":"","previous_headings":"","what":"Introduction","title":"Additional tidyverse Functions","text":"tidyplus provides functions str_crush(), add_missing_column(), coalesce_data() drop_na_all() complement ‘tidyverse’ functionality functions provide alternative behaviors if_else2() str_detect2().","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Additional tidyverse Functions","text":"can install development version tidyplus GitHub :","code":"# install.packages(\"devtools\") devtools::install_github(\"poissonconsulting/tidyplus\")"},{"path":"https://poissonconsulting.github.io/tidyplus/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Additional tidyverse Functions","text":"Please note tidyplus project released Contributor Code Conduct. contributing project, agree abide terms.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/add_missing_column.html","id":null,"dir":"Reference","previous_headings":"","what":"Add missing columns to a data frame — add_missing_column","title":"Add missing columns to a data frame — add_missing_column","text":"convenient way add one columns (already present) existing data frame. useful ensure required columns present data frame.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/add_missing_column.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add missing columns to a data frame — add_missing_column","text":"","code":"add_missing_column( .data, ..., .before = NULL, .after = NULL, .name_repair = c(\"check_unique\", \"unique\", \"universal\", \"minimal\") )"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/add_missing_column.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add missing columns to a data frame — add_missing_column","text":".data Data frame append . ... Name-value pairs, passed tibble(). values must size .data size 1. ., .One-based column index column name add new columns, default: last column. .name_repair Treatment problematic column names: \"minimal\": name repair checks, beyond basic existence, \"unique\": Make sure names unique empty, \"check_unique\": (default value), name repair, check unique, \"universal\": Make names unique syntactic function: apply custom name repair (e.g., .name_repair = make.names names style base R). purrr-style anonymous function, see rlang::as_function() argument passed repair vctrs::vec_as_names(). See details terms strategies used enforce .","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/add_missing_column.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add missing columns to a data frame — add_missing_column","text":"original data frame missing columns added already present.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/add_missing_column.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add missing columns to a data frame — add_missing_column","text":"wrapper tibble::add_column() error column already present.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/add_missing_column.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add missing columns to a data frame — add_missing_column","text":"","code":"data <- tibble::tibble(x = 1:3, y = 3:1) tibble::add_column(data, z = -1:1, w = 0) #> # A tibble: 3 × 4 #> x y z w #> #> 1 1 3 -1 0 #> 2 2 2 0 0 #> 3 3 1 1 0 add_missing_column(data, z = -1:1, .before = \"y\") #> # A tibble: 3 × 3 #> x z y #> #> 1 1 -1 3 #> 2 2 0 2 #> 3 3 1 1 # add_column errors if already present try(tibble::add_column(data, x = 4:6)) #> Error in tibble::add_column(data, x = 4:6) : #> Column name `x` must not be duplicated. #> Use `.name_repair` to specify repair. #> Caused by error in `repaired_names()`: #> ! Names must be unique. #> ✖ These names are duplicated: #> * \"x\" at locations 1 and 3. # add_missing_column silently ignores add_missing_column(data, x = 4:6) #> # A tibble: 3 × 2 #> x y #> #> 1 1 3 #> 2 2 2 #> 3 3 1"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/coalesce_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Coalesce Data — coalesce_data","title":"Coalesce Data — coalesce_data","text":"Coalesce values multiple columns finding first non-missing value position. Coalesced columns removed.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/coalesce_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Coalesce Data — coalesce_data","text":"","code":"coalesce_data(x, coalesce = list(), quiet = FALSE)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/coalesce_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Coalesce Data — coalesce_data","text":"x data frame. coalesce uniquely named list character vectors names new column names values names columns coalesce. single value provided column treated regular expression. quiet flag specifying whether provide messages.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/coalesce_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Coalesce Data — coalesce_data","text":"original data frame one columns coalesced new column.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/coalesce_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Coalesce Data — coalesce_data","text":"Coalescence performed order specified coalesce argument column produced coalescence can coalesced.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/coalesce_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Coalesce Data — coalesce_data","text":"","code":"data <- data.frame(x = c(1, NA, NA), y = c(NA, 3, NA), z = c(7, 8, 9), a = c(4, 5, 6)) coalesce_data(data, list(b = c(\"x\", \"y\")), quiet = TRUE) #> z a b #> 1 7 4 1 #> 2 8 5 3 #> 3 9 6 NA coalesce_data(data, list(z = c(\"y\", \"x\"), d = c(\"z\", \"a\"))) #> Coalesced 'z' from: 'y' and 'x' #> Coalesced 'd' from: 'z' and 'a' #> d #> 1 1 #> 2 3 #> 3 6"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/collapse_comments.html","id":null,"dir":"Reference","previous_headings":"","what":"Collapse Comments — collapse_comments","title":"Collapse Comments — collapse_comments","text":"Collapse comments coercing element string (character scalar) collapsing single string using '. ' separator.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/collapse_comments.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Collapse Comments — collapse_comments","text":"","code":"collapse_comments(...)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/collapse_comments.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collapse Comments — collapse_comments","text":"... objects collapsed string.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/collapse_comments.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Collapse Comments — collapse_comments","text":"string collapsed comments.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/collapse_comments.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Collapse Comments — collapse_comments","text":"","code":"collapse_comments(\"Saw fish\", character(0), \"Nice. .\", NA_character_) #> [1] \"Saw fish. Nice.\" data <- data.frame( visit = c(1, 1, 2, 2), fish = 1:4, comment = c(\"Sunny day. \", \"Skinny fish\", \"Lost boot\", NA) ) if (FALSE) { # \\dontrun{ data |> dplyr::group_by(visit) |> dplyr::summarise(comment = collapse_comments(comment)) |> dplyr::ungroup() } # }"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_na_all.html","id":null,"dir":"Reference","previous_headings":"","what":"Drop rows containing all missing values — drop_na_all","title":"Drop rows containing all missing values — drop_na_all","text":"convenient way drop uninformative rows data frame.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_na_all.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Drop rows containing all missing values — drop_na_all","text":"","code":"drop_na_all(data, ...)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_na_all.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Drop rows containing all missing values — drop_na_all","text":"data data frame. ... Columns inspect missing values. empty, columns used.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_na_all.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Drop rows containing all missing values — drop_na_all","text":"original data frame rows values missing dropped.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_na_all.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Drop rows containing all missing values — drop_na_all","text":"","code":"data <- tibble::tibble( a = c(NA, NA, NA), b = c(1, 1, NA), c = c(2, NA, NA) ) drop_na_all(data) #> # A tibble: 2 × 3 #> a b c #> #> 1 NA 1 2 #> 2 NA 1 NA drop_na_all(data, a, c) #> # A tibble: 1 × 3 #> a b c #> #> 1 NA 1 2"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_uninformative_columns.html","id":null,"dir":"Reference","previous_headings":"","what":"Drop uninformative columns from a data frame — drop_uninformative_columns","title":"Drop uninformative columns from a data frame — drop_uninformative_columns","text":"convenient way drop columns one value (missing ) na_distinct = FALSE also drop columns one value /missing values.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_uninformative_columns.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Drop uninformative columns from a data frame — drop_uninformative_columns","text":"","code":"drop_uninformative_columns(data, na_distinct = TRUE)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_uninformative_columns.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Drop uninformative columns from a data frame — drop_uninformative_columns","text":"data data frame. na_distinct flag specifying whether treat missing values distinct values.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_uninformative_columns.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Drop uninformative columns from a data frame — drop_uninformative_columns","text":"original data frame informative columns.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/drop_uninformative_columns.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Drop uninformative columns from a data frame — drop_uninformative_columns","text":"","code":"data <- tibble::tibble( a = c(1, 1, 1), x = c(NA, NA, NA), b = c(1, 1, NA), z = c(1, 2, 2), e = c(1, 2, NA) ) drop_uninformative_columns(data) #> # A tibble: 3 × 3 #> b z e #> #> 1 1 1 1 #> 2 1 2 2 #> 3 NA 2 NA drop_uninformative_columns(data, na_distinct = FALSE) #> # A tibble: 3 × 2 #> z e #> #> 1 1 1 #> 2 2 2 #> 3 2 NA"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/duplicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Keep non-unique rows in a data frame — duplicates","title":"Keep non-unique rows in a data frame — duplicates","text":"Keeps non-unique rows within data frame.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/duplicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Keep non-unique rows in a data frame — duplicates","text":"","code":"duplicates(.data, ..., .keep_all = TRUE)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/duplicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Keep non-unique rows in a data frame — duplicates","text":".data data.frame. ... Optional variables use determining non-uniqueness. omitted, use variables data frame. .keep_all flag specifying whether keep variables .data.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/duplicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Keep non-unique rows in a data frame — duplicates","text":"original data frame non-unique rows.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/duplicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Keep non-unique rows in a data frame — duplicates","text":"","code":"data <- tibble::tibble(x = c(1, 2, 1, 1), y = c(1, 1, 1, 5)) duplicates(data) #> # A tibble: 2 × 2 #> x y #> #> 1 1 1 #> 2 1 1 duplicates(data, x) #> # A tibble: 3 × 2 #> x y #> #> 1 1 1 #> 2 1 1 #> 3 1 5 duplicates(data, y) #> # A tibble: 3 × 2 #> x y #> #> 1 1 1 #> 2 2 1 #> 3 1 1 duplicates(data, x, y) #> # A tibble: 2 × 2 #> x y #> #> 1 1 1 #> 2 1 1 duplicates(data, y, .keep_all = FALSE) #> # A tibble: 3 × 1 #> y #> #> 1 1 #> 2 1 #> 3 1"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/if_else2.html","id":null,"dir":"Reference","previous_headings":"","what":"Vectorised if else. — if_else2","title":"Vectorised if else. — if_else2","text":"Vectorised else true returns first possibility otherwise returns second possibility (even condition missing value). searching character vectors alternative solution use str_detect2().","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/if_else2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Vectorised if else. — if_else2","text":"","code":"if_else2(condition, true, false)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/if_else2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Vectorised if else. — if_else2","text":"condition logical vector true, false Vectors use TRUE FALSE values condition. true false recycled size condition. true, false, missing (used) cast common type.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/if_else2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Vectorised if else. — if_else2","text":"condition TRUE, matching value true, FALSE NA, matching value false.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/if_else2.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Vectorised if else. — if_else2","text":"","code":"# consider the following data frame data <- tibble::tibble( x = c(TRUE, FALSE, NA), y = c(\"x is false\", NA, \"hello\") ) # with a single vector if_else2() behaves the same as the default call to if_else(). dplyr::mutate(data, y1 = dplyr::if_else(y != \"x is false\", \"x is true\", y), y2 = if_else2(y != \"x is false\", \"x is true\", y) ) #> # A tibble: 3 × 4 #> x y y1 y2 #> #> 1 TRUE x is false x is false x is false #> 2 FALSE NA NA NA #> 3 NA hello x is true x is true # however in the case of a second vector the use of # if_else2() does not introduce missing values dplyr::mutate(data, x1 = dplyr::if_else(stringr::str_detect(y, \"x is false\"), FALSE, x), x2 = if_else2(stringr::str_detect(y, \"x is false\"), FALSE, x) ) #> # A tibble: 3 × 4 #> x y x1 x2 #> #> 1 TRUE x is false FALSE FALSE #> 2 FALSE NA NA FALSE #> 3 NA hello NA NA # in the case of regular expression matching an alternative is to use # str_detect2() dplyr::mutate(data, x3 = dplyr::if_else(str_detect2(y, \"x is false\"), FALSE, x) ) #> # A tibble: 3 × 3 #> x y x3 #> #> 1 TRUE x is false FALSE #> 2 FALSE NA FALSE #> 3 NA hello NA"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/only.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract the only distinct value from a vector — only","title":"Extract the only distinct value from a vector — only","text":"Extracts distinct value atomic vector throws informative error values multiple distinct values.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/only.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract the only distinct value from a vector — only","text":"","code":"only(x, na_rm = FALSE)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/only.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract the only distinct value from a vector — only","text":"x atomic vector. na_rm flag indicating whether exclude missing values.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/only.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract the only distinct value from a vector — only","text":"distinct value vector otherwise throws error.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/only.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Extract the only distinct value from a vector — only","text":"() useful summarizing vector group checking assumption constant within group.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/only.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract the only distinct value from a vector — only","text":"","code":"only(c(1, 1)) #> [1] 1 only(c(NA, NA)) #> [1] NA only(c(1, 1, NA), na_rm = TRUE) #> [1] 1 try(only(character(0))) #> Error in only(character(0)) : `x` must have at least 1 element. try(only(c(1, NA))) #> Error in only(c(1, NA)) : `x` must only have 1 distinct value. try(only(c(1, 2))) #> Error in only(c(1, 2)) : `x` must only have 1 distinct value."},{"path":"https://poissonconsulting.github.io/tidyplus/reference/replace_na_if.html","id":null,"dir":"Reference","previous_headings":"","what":"Conditional replacement of NAs with specified values — replace_na_if","title":"Conditional replacement of NAs with specified values — replace_na_if","text":"Unlike tidyr::replace_na(), defined vectors.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/replace_na_if.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Conditional replacement of NAs with specified values — replace_na_if","text":"","code":"replace_na_if(x, condition, true)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/replace_na_if.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Conditional replacement of NAs with specified values — replace_na_if","text":"x Vector missing values modify. condition logical vector true replacement values condition TRUE.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/replace_na_if.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Conditional replacement of NAs with specified values — replace_na_if","text":"modified version x replaces missing values condition TRUE true.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/replace_na_if.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Conditional replacement of NAs with specified values — replace_na_if","text":"replace_na_if() wrapper if_else2(.na(x) & condition, true, x)","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/replace_na_if.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Conditional replacement of NAs with specified values — replace_na_if","text":"","code":"data <- tibble::tibble( x = c(TRUE, FALSE, NA), y = c(\"x is false\", NA, \"x is false\") ) dplyr::mutate(data, x1 = tidyr::replace_na(x, FALSE), x3 = if_else2(is.na(x) & y == \"x is false\", FALSE, x), x4 = replace_na_if(x, y == \"x is false\", FALSE) ) #> # A tibble: 3 × 5 #> x y x1 x3 x4 #> #> 1 TRUE x is false TRUE TRUE TRUE #> 2 FALSE NA FALSE FALSE FALSE #> 3 NA x is false FALSE FALSE FALSE"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_crush.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove whitespace from a string — str_crush","title":"Remove whitespace from a string — str_crush","text":"str_crush(), removes whitespace string, logical extension stringr::str_trim() stringr::str_squish().","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_crush.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove whitespace from a string — str_crush","text":"","code":"str_crush(string)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_crush.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove whitespace from a string — str_crush","text":"string Input vector. Either character vector, something coercible one.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_crush.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove whitespace from a string — str_crush","text":"character vector length string.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_crush.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Remove whitespace from a string — str_crush","text":"str_crush() considered specialized part stringr.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_crush.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove whitespace from a string — str_crush","text":"","code":"str_crush(\" String with trailing, middle, and leading white space\\t\") #> [1] \"Stringwithtrailing,middle,andleadingwhitespace\""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_detect2.html","id":null,"dir":"Reference","previous_headings":"","what":"Detect the presence/absence of a match — str_detect2","title":"Detect the presence/absence of a match — str_detect2","text":"Vectorised string pattern. Actually equivalent grepl(pattern, x) returns FALSE NAs (unlike stringr::str_detect()). behavior useful searching comments many NA indicate comments present.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_detect2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detect the presence/absence of a match — str_detect2","text":"","code":"str_detect2(string, pattern, negate = FALSE)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_detect2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detect the presence/absence of a match — str_detect2","text":"string Input vector. Either character vector, something coercible one. pattern Pattern look . default interpretation regular expression, described vignette(\"regular-expressions\"). Use regex() finer control matching behaviour. Match fixed string (.e. comparing bytes), using fixed(). fast, approximate. Generally, matching human text, want coll() respects character matching rules specified locale. Match character, word, line sentence boundaries boundary(). empty pattern, \"\", equivalent boundary(\"character\"). negate TRUE, inverts resulting boolean vector.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_detect2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Detect the presence/absence of a match — str_detect2","text":"logical vector length string/pattern.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_detect2.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Detect the presence/absence of a match — str_detect2","text":"","code":"x <- c(\"b\", NA, \"ab\") pattern <- \"^a\" grepl(pattern, x) #> [1] FALSE FALSE TRUE stringr::str_detect(x, pattern) #> [1] FALSE NA TRUE str_detect2(x, pattern) #> [1] FALSE FALSE TRUE"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_replace_vec.html","id":null,"dir":"Reference","previous_headings":"","what":"String replace multiple strings — str_replace_vec","title":"String replace multiple strings — str_replace_vec","text":"String replace multiple strings vector.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_replace_vec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"String replace multiple strings — str_replace_vec","text":"","code":"str_replace_vec(string, replace)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_replace_vec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"String replace multiple strings — str_replace_vec","text":"string Input vector. Either character vector, something coercible one. replace character vector names patterns look values replacement values (c(pattern1 = replacement1))","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_replace_vec.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"String replace multiple strings — str_replace_vec","text":"character vector length string/pattern/replacement.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_replace_vec.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"String replace multiple strings — str_replace_vec","text":"str_replace_vec() vectorized form stringr::str_replace(). different passing named vector stringr::str_replace_all, performs multiple replacements pattern matches string.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_replace_vec.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"String replace multiple strings — str_replace_vec","text":"","code":"fruits <- c(\"two apples\", \"nine pears\") str_replace_vec(fruits, c(\"two\" = \"three\", \"nine\" = \"ten\")) #> [1] \"three apples\" \"ten pears\""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_to_snake_case.html","id":null,"dir":"Reference","previous_headings":"","what":"Converts strings to Snake Case — str_to_snake_case","title":"Converts strings to Snake Case — str_to_snake_case","text":"Converts strings Snake Case","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_to_snake_case.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Converts strings to Snake Case — str_to_snake_case","text":"","code":"str_to_snake_case(x)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_to_snake_case.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Converts strings to Snake Case — str_to_snake_case","text":"x input string multiple strings converted snake case","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_to_snake_case.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Converts strings to Snake Case — str_to_snake_case","text":"string strings converted snake_case","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/str_to_snake_case.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Converts strings to Snake Case — str_to_snake_case","text":"","code":"str_to_snake_case(\"string of words\") #> [1] \"string_of_words\" str_to_snake_case(\"StringOfWords\") #> [1] \"string_of_words\" str_to_snake_case(\"s!t$ring of %char^&act*ers\") #> [1] \"string_of_characters\" str_to_snake_case(c(\"multiples of strings\", \"strings in multiple\", \"many strings\")) #> [1] \"multiples_of_strings\" \"strings_in_multiple\" \"many_strings\""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/summarise2.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarise Each Group Down to One Row — summarise2","title":"Summarise Each Group Down to One Row — summarise2","text":"Wrapper dplyr::summarise sets default .group variable \"keep\". means groups set dplyr::group_by retained, just first group.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/summarise2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarise Each Group Down to One Row — summarise2","text":"","code":"summarise2(.data, ..., .by = NULL, .groups = \"keep\") summarize2(.data, ..., .by = NULL, .groups = \"keep\")"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/summarise2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarise Each Group Down to One Row — summarise2","text":".data data frame, data frame extension (e.g. tibble), lazy data frame (e.g. dbplyr dtplyr). See Methods, , details. ... Name-value pairs summary functions. name name variable result. value can : vector length 1, e.g. min(x), n(), sum(.na(y)). data frame, add multiple columns single expression. Returning values size 0 >1 deprecated 1.1.0. Please use reframe() instead. . Optionally, selection columns group just operation, functioning alternative group_by(). details examples, see ?dplyr_by. .groups Grouping structure result. \"drop_last\": dropping last level grouping. supported option version 1.0.0. \"drop\": levels grouping dropped. \"keep\": grouping structure .data. \"rowwise\": row group. .groups specified, chosen based number rows results: results 1 row, get \"drop_last\". number rows varies, get \"keep\" (note returning variable number rows deprecated favor reframe(), also unconditionally drops levels grouping). addition, message informs choice, unless result ungrouped, option \"dplyr.summarise.inform\" set FALSE, summarise() called function package.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/summarise2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarise Each Group Down to One Row — summarise2","text":"object usually type .data. rows come underlying group_keys(). columns combination grouping keys summary expressions provide. grouping structure controlled .groups= argument, output may another grouped_df, tibble rowwise data frame. Data frame attributes preserved, summarise() fundamentally creates new data frame.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/summarise2.html","id":"useful-functions","dir":"Reference","previous_headings":"","what":"Useful functions","title":"Summarise Each Group Down to One Row — summarise2","text":"Center: mean(), median() Spread: sd(), IQR(), mad() Range: min(), max(), Position: first(), last(), nth(), Count: n(), n_distinct() Logical: (), ()","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/summarise2.html","id":"backend-variations","dir":"Reference","previous_headings":"","what":"Backend variations","title":"Summarise Each Group Down to One Row — summarise2","text":"data frame backend supports creating variable using summary. means previously created summary variables can transformed combined within summary, mutate(). However, also means summary variables names previous variables overwrite , making variables unavailable later summary variables. behaviour may supported backends. avoid unexpected results, consider using new names summary variables, especially creating multiple summaries.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/summarise2.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Summarise Each Group Down to One Row — summarise2","text":"function generic, means packages can provide implementations (methods) classes. See documentation individual methods extra arguments differences behaviour. following methods currently available loaded packages: methods found .","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/summarise2.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Summarise Each Group Down to One Row — summarise2","text":"","code":"df <- data.frame( group = c(\"A\", \"A\", \"B\", \"B\"), id = c(1, 1, 2, 2), value = c(10, 4, 20, 6) ) # summarise2 doesn't produce message about groups df |> dplyr::group_by(group, id) |> summarise2(mean = mean(value)) #> # A tibble: 2 × 3 #> # Groups: group, id [2] #> group id mean #> #> 1 A 1 7 #> 2 B 2 13 # summarise doesn't retain all the groups set in `group_by` df |> dplyr::group_by(group, id) |> dplyr::summarise(mean = mean(value)) #> `summarise()` has grouped output by 'group'. You can override using the #> `.groups` argument. #> # A tibble: 2 × 3 #> # Groups: group [2] #> group id mean #> #> 1 A 1 7 #> 2 B 2 13"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/tidyplus-package.html","id":null,"dir":"Reference","previous_headings":"","what":"tidyplus: Additional 'tidyverse' Functions — tidyplus-package","title":"tidyplus: Additional 'tidyverse' Functions — tidyplus-package","text":"Provides functions str_crush(), add_missing_column(), coalesce_data() drop_na_all() complement 'tidyverse' functionality functions provide alternative behaviors if_else2() str_detect2().","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/tidyplus-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"tidyplus: Additional 'tidyverse' Functions — tidyplus-package","text":"Maintainer: Ayla Pearson ayla@poissonconsulting.ca (ORCID) Authors: Joe Thorley joe@poissonconsulting.ca (ORCID) contributors: Poisson Consulting [copyright holder, funder]","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/unite_str.html","id":null,"dir":"Reference","previous_headings":"","what":"Unite multiple character columns into one — unite_str","title":"Unite multiple character columns into one — unite_str","text":"Convenience function combining character columns.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/unite_str.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Unite multiple character columns into one — unite_str","text":"","code":"unite_str(data, col, ..., sep = \". \", remove = TRUE)"},{"path":"https://poissonconsulting.github.io/tidyplus/reference/unite_str.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Unite multiple character columns into one — unite_str","text":"data data frame. col name new column, string symbol. argument passed expression supports quasiquotation (can unquote strings symbols). name captured expression rlang::ensym() (note kind interface symbols represent actual objects now discouraged tidyverse; support backward compatibility). ... Columns unite sep Separator use values. remove TRUE, remove input columns output data frame.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/unite_str.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Unite multiple character columns into one — unite_str","text":"original data frame one columns combined character vectors separated period.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/reference/unite_str.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Unite multiple character columns into one — unite_str","text":"Blank values \"\" converted missing values.","code":""},{"path":[]},{"path":"https://poissonconsulting.github.io/tidyplus/reference/unite_str.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Unite multiple character columns into one — unite_str","text":"","code":"data <- tibble::tibble(x = c(\"good\", \"Saw fish.\", \"\", NA), y = c(\"2021\", NA, NA, NA)) # unite has poor handling of character vectors tidyr::unite(data, \"new\", x, y, remove = FALSE) #> # A tibble: 4 × 3 #> new x y #> #> 1 good_2021 \"good\" 2021 #> 2 Saw fish._NA \"Saw fish.\" NA #> 3 _NA \"\" NA #> 4 NA_NA NA NA unite_str(data, \"new\", x, y, remove = FALSE) #> # A tibble: 4 × 3 #> new x y #> #> 1 good. 2021 good 2021 #> 2 Saw fish. Saw fish. NA #> 3 NA NA NA #> 4 NA NA NA"},{"path":"https://poissonconsulting.github.io/tidyplus/news/index.html","id":"tidyplus-0109002","dir":"Changelog","previous_headings":"","what":"tidyplus 0.1.0.9002","title":"tidyplus 0.1.0.9002","text":"Added informative error message if_else2() matches found","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/news/index.html","id":"tidyplus-0109001","dir":"Changelog","previous_headings":"","what":"tidyplus 0.1.0.9001","title":"tidyplus 0.1.0.9001","text":"Internal changes.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/news/index.html","id":"tidyplus-0109000","dir":"Changelog","previous_headings":"","what":"tidyplus 0.1.0.9000","title":"tidyplus 0.1.0.9000","text":"duplicates() now preserves groups attributes “regular” “sf” data frames. Added tests duplicates().","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/news/index.html","id":"tidyplus-010","dir":"Changelog","previous_headings":"","what":"tidyplus 0.1.0","title":"tidyplus 0.1.0","text":"Added str_replace_vec() function. Added duplicates() function. Added str_to_snake_case() function. Added summarise2() function.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/news/index.html","id":"tidyplus-002","dir":"Changelog","previous_headings":"","what":"tidyplus 0.0.2","title":"tidyplus 0.0.2","text":"CRAN release: 2022-12-16 Make package compatible upcoming release dplyr 1.1.0. Added repository bug reports URLs.","code":""},{"path":"https://poissonconsulting.github.io/tidyplus/news/index.html","id":"tidyplus-001","dir":"Changelog","previous_headings":"","what":"tidyplus 0.0.1","title":"tidyplus 0.0.1","text":"CRAN release: 2022-08-29 Released CRAN release.","code":""}]
Thorley J (2024). tidyplus: Additional 'tidyverse' Functions. -R package version 0.1.0.9001, https://github.com/poissonconsulting/tidyplus, https://poissonconsulting.github.io/tidyplus/. +R package version 0.1.0.9002, https://github.com/poissonconsulting/tidyplus, https://poissonconsulting.github.io/tidyplus/.
@Manual{, title = {tidyplus: Additional 'tidyverse' Functions}, author = {Joe Thorley}, year = {2024}, - note = {R package version 0.1.0.9001, https://github.com/poissonconsulting/tidyplus}, + note = {R package version 0.1.0.9002, https://github.com/poissonconsulting/tidyplus}, url = {https://poissonconsulting.github.io/tidyplus/}, }
NEWS.md
if_else2()