From 71ec6e5f35a4e1f5c268c9ff635ddb11bd1f62dc Mon Sep 17 00:00:00 2001 From: christopherkenny Date: Sat, 30 Dec 2023 19:26:45 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20christop?= =?UTF-8?q?herkenny/censable@612668a7559bf27960e5d3637878524c5d348af1=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 2 +- LICENSE-text.html | 2 +- LICENSE.html | 3 +- authors.html | 11 +++--- index.html | 4 ++- news/index.html | 6 +++- pkgdown.yml | 6 ++-- reference/add_r_environ.html | 2 +- reference/breakdown_geoid.html | 2 +- reference/build_acs.html | 2 +- reference/build_dec.html | 2 +- reference/collapse4.html | 2 +- reference/collapse4_pop.html | 2 +- reference/collapse4_vap.html | 2 +- reference/collapse5.html | 2 +- reference/collapse5_pop.html | 2 +- reference/collapse5_vap.html | 2 +- reference/construct_geoid.html | 2 +- reference/custom_geoid.html | 2 +- reference/fips_2000.html | 2 +- reference/fips_2010.html | 2 +- reference/fips_2020.html | 2 +- reference/index.html | 2 +- reference/join_abb_ansi.html | 2 +- reference/join_abb_fips.html | 2 +- reference/join_abb_name.html | 2 +- reference/join_ansi_abb.html | 2 +- reference/join_ansi_fips.html | 2 +- reference/join_ansi_name.html | 2 +- reference/join_fips_abb.html | 2 +- reference/join_fips_ansi.html | 2 +- reference/join_fips_name.html | 2 +- reference/join_name_abb.html | 2 +- reference/join_name_ansi.html | 2 +- reference/join_name_fips.html | 2 +- reference/key.html | 2 +- reference/match_abb.html | 2 +- reference/match_ansi.html | 2 +- reference/match_fips.html | 2 +- reference/match_name.html | 2 +- reference/mt_county.html | 2 +- reference/pipe.html | 2 +- reference/recode_abb_ansi.html | 2 +- reference/recode_abb_fips.html | 2 +- reference/recode_abb_name.html | 2 +- reference/recode_ansi_abb.html | 2 +- reference/recode_ansi_fips.html | 2 +- reference/recode_ansi_name.html | 2 +- reference/recode_fips_abb.html | 2 +- reference/recode_fips_ansi.html | 2 +- reference/recode_fips_name.html | 2 +- reference/recode_name_abb.html | 2 +- reference/recode_name_ansi.html | 2 +- reference/recode_name_fips.html | 2 +- reference/stata.html | 2 +- reference/tidyeval.html | 60 ++++++++++++++++----------------- 56 files changed, 99 insertions(+), 91 deletions(-) diff --git a/404.html b/404.html index a972281..a6c80e5 100644 --- a/404.html +++ b/404.html @@ -95,7 +95,7 @@

Page not found (404)

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/LICENSE-text.html b/LICENSE-text.html index b83e48b..292f92d 100644 --- a/LICENSE-text.html +++ b/LICENSE-text.html @@ -65,7 +65,7 @@

License

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/LICENSE.html b/LICENSE.html index 3aa3ea2..53ff14a 100644 --- a/LICENSE.html +++ b/LICENSE.html @@ -47,6 +47,7 @@

MIT License

+

Copyright (c) 2021 Christopher T. Kenny

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

@@ -68,7 +69,7 @@

MIT License

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/authors.html b/authors.html index ad3299e..0caf80b 100644 --- a/authors.html +++ b/authors.html @@ -61,15 +61,16 @@

Citation

-

Kenny C (2022). +

Kenny C (2023). censable: Making Census Data More Usable. -https://christophertkenny.com/censable/, https://github.com/christopherkenny/censable. +R package version 0.0.5, https://github.com/christopherkenny/censable, https://christophertkenny.com/censable/.

@Manual{,
   title = {censable: Making Census Data More Usable},
   author = {Christopher T. Kenny},
-  year = {2022},
-  note = {https://christophertkenny.com/censable/, https://github.com/christopherkenny/censable},
+  year = {2023},
+  note = {R package version 0.0.5, https://github.com/christopherkenny/censable},
+  url = {https://christophertkenny.com/censable/},
 }
@@ -83,7 +84,7 @@

Citation

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/index.html b/index.html index 6d114d6..8ae4f45 100644 --- a/index.html +++ b/index.html @@ -79,6 +79,7 @@ +

censable wraps censusapi for common requests, with memoized data functions. With a growing redistricting universe in R, it seems right to partition out some use cases, to allow imports to be more targeted and to stop packages from repeating each other.

Installation @@ -146,6 +147,7 @@

Developers

Dev status

@@ -162,7 +164,7 @@

Dev status

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/news/index.html b/news/index.html index 0bbc64d..4b5a2b4 100644 --- a/news/index.html +++ b/news/index.html @@ -47,6 +47,10 @@

Changelog

Source: NEWS.md
+
+ +
diff --git a/pkgdown.yml b/pkgdown.yml index 2a98ecc..ce37f31 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -1,8 +1,8 @@ -pandoc: 2.7.3 -pkgdown: 2.0.6 +pandoc: 2.19.2 +pkgdown: 2.0.7 pkgdown_sha: ~ articles: {} -last_built: 2022-11-19T18:46Z +last_built: 2023-12-30T19:26Z urls: reference: https://christopherkenny.github.io/censable/reference article: https://christopherkenny.github.io/censable/articles diff --git a/reference/add_r_environ.html b/reference/add_r_environ.html index 7650bf8..bbf3121 100644 --- a/reference/add_r_environ.html +++ b/reference/add_r_environ.html @@ -114,7 +114,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/breakdown_geoid.html b/reference/breakdown_geoid.html index f127a83..cd5c864 100644 --- a/reference/breakdown_geoid.html +++ b/reference/breakdown_geoid.html @@ -98,7 +98,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/build_acs.html b/reference/build_acs.html index 2513f28..abd61f3 100644 --- a/reference/build_acs.html +++ b/reference/build_acs.html @@ -217,7 +217,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/build_dec.html b/reference/build_dec.html index f590d4a..6e46f61 100644 --- a/reference/build_dec.html +++ b/reference/build_dec.html @@ -175,7 +175,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/collapse4.html b/reference/collapse4.html index d261878..09956b3 100644 --- a/reference/collapse4.html +++ b/reference/collapse4.html @@ -91,7 +91,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/collapse4_pop.html b/reference/collapse4_pop.html index 0fc9f4f..502ab30 100644 --- a/reference/collapse4_pop.html +++ b/reference/collapse4_pop.html @@ -91,7 +91,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/collapse4_vap.html b/reference/collapse4_vap.html index 5636098..978ae59 100644 --- a/reference/collapse4_vap.html +++ b/reference/collapse4_vap.html @@ -91,7 +91,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/collapse5.html b/reference/collapse5.html index 3445b17..cd5c08c 100644 --- a/reference/collapse5.html +++ b/reference/collapse5.html @@ -91,7 +91,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/collapse5_pop.html b/reference/collapse5_pop.html index 62b6f47..a3f19ab 100644 --- a/reference/collapse5_pop.html +++ b/reference/collapse5_pop.html @@ -91,7 +91,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/collapse5_vap.html b/reference/collapse5_vap.html index 47c55a6..cb68d6b 100644 --- a/reference/collapse5_vap.html +++ b/reference/collapse5_vap.html @@ -91,7 +91,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/construct_geoid.html b/reference/construct_geoid.html index 06632be..8b7a5a9 100644 --- a/reference/construct_geoid.html +++ b/reference/construct_geoid.html @@ -145,7 +145,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/custom_geoid.html b/reference/custom_geoid.html index e63e4fd..c803e35 100644 --- a/reference/custom_geoid.html +++ b/reference/custom_geoid.html @@ -91,7 +91,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/fips_2000.html b/reference/fips_2000.html index 6fd521f..e309aef 100644 --- a/reference/fips_2000.html +++ b/reference/fips_2000.html @@ -87,7 +87,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/fips_2010.html b/reference/fips_2010.html index a0a1bca..b3c3c2a 100644 --- a/reference/fips_2010.html +++ b/reference/fips_2010.html @@ -87,7 +87,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/fips_2020.html b/reference/fips_2020.html index f362de0..51cfa97 100644 --- a/reference/fips_2020.html +++ b/reference/fips_2020.html @@ -87,7 +87,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/index.html b/reference/index.html index 8702a32..3e2b654 100644 --- a/reference/index.html +++ b/reference/index.html @@ -275,7 +275,7 @@

Other

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/join_abb_ansi.html b/reference/join_abb_ansi.html index e817ccf..13f678b 100644 --- a/reference/join_abb_ansi.html +++ b/reference/join_abb_ansi.html @@ -207,7 +207,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/join_abb_fips.html b/reference/join_abb_fips.html index 83c4024..5299e65 100644 --- a/reference/join_abb_fips.html +++ b/reference/join_abb_fips.html @@ -207,7 +207,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/join_abb_name.html b/reference/join_abb_name.html index 5c7c7df..ada74ba 100644 --- a/reference/join_abb_name.html +++ b/reference/join_abb_name.html @@ -207,7 +207,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/join_ansi_abb.html b/reference/join_ansi_abb.html index c0df5f4..78c4dc7 100644 --- a/reference/join_ansi_abb.html +++ b/reference/join_ansi_abb.html @@ -207,7 +207,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/join_ansi_fips.html b/reference/join_ansi_fips.html index 3cb3fe4..e15952f 100644 --- a/reference/join_ansi_fips.html +++ b/reference/join_ansi_fips.html @@ -207,7 +207,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/join_ansi_name.html b/reference/join_ansi_name.html index 408ce66..30e291f 100644 --- a/reference/join_ansi_name.html +++ b/reference/join_ansi_name.html @@ -207,7 +207,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/join_fips_abb.html b/reference/join_fips_abb.html index 041977d..05bfe1d 100644 --- a/reference/join_fips_abb.html +++ b/reference/join_fips_abb.html @@ -207,7 +207,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/join_fips_ansi.html b/reference/join_fips_ansi.html index 1368e2d..198b67b 100644 --- a/reference/join_fips_ansi.html +++ b/reference/join_fips_ansi.html @@ -207,7 +207,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/join_fips_name.html b/reference/join_fips_name.html index a3be473..751f1fb 100644 --- a/reference/join_fips_name.html +++ b/reference/join_fips_name.html @@ -207,7 +207,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/join_name_abb.html b/reference/join_name_abb.html index 0829917..a9bc7ea 100644 --- a/reference/join_name_abb.html +++ b/reference/join_name_abb.html @@ -207,7 +207,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/join_name_ansi.html b/reference/join_name_ansi.html index 835d89c..e02b62a 100644 --- a/reference/join_name_ansi.html +++ b/reference/join_name_ansi.html @@ -207,7 +207,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/join_name_fips.html b/reference/join_name_fips.html index a6b9397..c7bb8f9 100644 --- a/reference/join_name_fips.html +++ b/reference/join_name_fips.html @@ -207,7 +207,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/key.html b/reference/key.html index 534f61e..80c033f 100644 --- a/reference/key.html +++ b/reference/key.html @@ -91,7 +91,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/match_abb.html b/reference/match_abb.html index 6456b33..4796ae8 100644 --- a/reference/match_abb.html +++ b/reference/match_abb.html @@ -89,7 +89,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/match_ansi.html b/reference/match_ansi.html index 28a6375..03f4c61 100644 --- a/reference/match_ansi.html +++ b/reference/match_ansi.html @@ -89,7 +89,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/match_fips.html b/reference/match_fips.html index 4e0299e..f817751 100644 --- a/reference/match_fips.html +++ b/reference/match_fips.html @@ -89,7 +89,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/match_name.html b/reference/match_name.html index 33904a0..4cee6ab 100644 --- a/reference/match_name.html +++ b/reference/match_name.html @@ -89,7 +89,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/mt_county.html b/reference/mt_county.html index 875b659..2c54fa6 100644 --- a/reference/mt_county.html +++ b/reference/mt_county.html @@ -125,7 +125,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/pipe.html b/reference/pipe.html index 1d434f9..fff98ca 100644 --- a/reference/pipe.html +++ b/reference/pipe.html @@ -85,7 +85,7 @@

Value

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/recode_abb_ansi.html b/reference/recode_abb_ansi.html index 4706415..62e044d 100644 --- a/reference/recode_abb_ansi.html +++ b/reference/recode_abb_ansi.html @@ -149,7 +149,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/recode_abb_fips.html b/reference/recode_abb_fips.html index e7b4960..b7a1fe2 100644 --- a/reference/recode_abb_fips.html +++ b/reference/recode_abb_fips.html @@ -149,7 +149,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/recode_abb_name.html b/reference/recode_abb_name.html index f8d789c..4c3e2f4 100644 --- a/reference/recode_abb_name.html +++ b/reference/recode_abb_name.html @@ -149,7 +149,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/recode_ansi_abb.html b/reference/recode_ansi_abb.html index 46c88a9..7ac9ecc 100644 --- a/reference/recode_ansi_abb.html +++ b/reference/recode_ansi_abb.html @@ -207,7 +207,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/recode_ansi_fips.html b/reference/recode_ansi_fips.html index ccc73f9..24d2214 100644 --- a/reference/recode_ansi_fips.html +++ b/reference/recode_ansi_fips.html @@ -149,7 +149,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/recode_ansi_name.html b/reference/recode_ansi_name.html index bd44d28..84b3d1d 100644 --- a/reference/recode_ansi_name.html +++ b/reference/recode_ansi_name.html @@ -149,7 +149,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/recode_fips_abb.html b/reference/recode_fips_abb.html index ab4cbda..1a45549 100644 --- a/reference/recode_fips_abb.html +++ b/reference/recode_fips_abb.html @@ -149,7 +149,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/recode_fips_ansi.html b/reference/recode_fips_ansi.html index 66d016a..ca7d1aa 100644 --- a/reference/recode_fips_ansi.html +++ b/reference/recode_fips_ansi.html @@ -149,7 +149,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/recode_fips_name.html b/reference/recode_fips_name.html index e69c203..e522af5 100644 --- a/reference/recode_fips_name.html +++ b/reference/recode_fips_name.html @@ -149,7 +149,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/recode_name_abb.html b/reference/recode_name_abb.html index e36d02a..92400ab 100644 --- a/reference/recode_name_abb.html +++ b/reference/recode_name_abb.html @@ -207,7 +207,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/recode_name_ansi.html b/reference/recode_name_ansi.html index ad6b2c7..7123172 100644 --- a/reference/recode_name_ansi.html +++ b/reference/recode_name_ansi.html @@ -149,7 +149,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/recode_name_fips.html b/reference/recode_name_fips.html index f57ad99..44ad992 100644 --- a/reference/recode_name_fips.html +++ b/reference/recode_name_fips.html @@ -207,7 +207,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/stata.html b/reference/stata.html index 9efa065..2ed97a9 100644 --- a/reference/stata.html +++ b/reference/stata.html @@ -93,7 +93,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.7.

diff --git a/reference/tidyeval.html b/reference/tidyeval.html index d2b623b..cf330c6 100644 --- a/reference/tidyeval.html +++ b/reference/tidyeval.html @@ -136,27 +136,27 @@

Tidy eval helpers

passed from function arguments inside other tidy eval functions. {{ is designed for individual arguments. To pass multiple arguments contained in dots, use ... in the normal way.

-

my_function <- function(data, var, ...) {
-  data %>%
-    group_by(...) %>%
-    summarise(mean = mean({{ var }}))
-}

+

my_function <- function(data, var, ...) {
+  data %>%
+    group_by(...) %>%
+    summarise(mean = mean({{ var }}))
+}

  • enquo() and enquos() delay the execution of one or several function arguments. The former returns a single expression, the latter returns a list of expressions. Once defused, expressions will no longer evaluate on their own. They must be injected back into an evaluation context with !! (for a single expression) and !!! (for a list of expressions).

    -

    my_function <- function(data, var, ...) {
    -  # Defuse
    -  var <- enquo(var)
    -  dots <- enquos(...)
    -
    -  # Inject
    -  data %>%
    -    group_by(!!!dots) %>%
    -    summarise(mean = mean(!!var))
    -}

    +

    my_function <- function(data, var, ...) {
    +  # Defuse
    +  var <- enquo(var)
    +  dots <- enquos(...)
    +
    +  # Inject
    +  data %>%
    +    group_by(!!!dots) %>%
    +    summarise(mean = mean(!!var))
    +}

    In this simple case, the code is equivalent to the usage of {{ and ... above. Defusing with enquo() or enquos() is only needed in more complex cases, for instance if you need to inspect @@ -164,29 +164,29 @@

    Tidy eval helpers

  • The .data pronoun is an object that represents the current slice of data. If you have a variable name in a string, use the .data pronoun to subset that variable with [[.

    -

    my_var <- "disp"
    -mtcars %>% summarise(mean = mean(.data[[my_var]]))

  • +

    my_var <- "disp"
    +mtcars %>% summarise(mean = mean(.data[[my_var]]))

  • Another tidy eval operator is :=. It makes it possible to use glue and curly-curly syntax on the LHS of =. For technical reasons, the R language doesn't support complex expressions on the left of =, so we use := as a workaround.

    -

    my_function <- function(data, var, suffix = "foo") {
    -  # Use `{{` to tunnel function arguments and the usual glue
    -  # operator `{` to interpolate plain strings.
    -  data %>%
    -    summarise("{{ var }}_mean_{suffix}" := mean({{ var }}))
    -}

  • +

    my_function <- function(data, var, suffix = "foo") {
    +  # Use `{{` to tunnel function arguments and the usual glue
    +  # operator `{` to interpolate plain strings.
    +  data %>%
    +    summarise("{{ var }}_mean_{suffix}" := mean({{ var }}))
    +}

  • Many tidy eval functions like dplyr::mutate() or dplyr::summarise() give an automatic name to unnamed inputs. If you need to create the same sort of automatic names by yourself, use as_label(). For instance, the glue-tunnelling syntax above can be reproduced manually with:

    -

    my_function <- function(data, var, suffix = "foo") {
    -  var <- enquo(var)
    -  prefix <- as_label(var)
    -  data %>%
    -    summarise("{prefix}_mean_{suffix}" := mean(!!var))
    -}

    +

    my_function <- function(data, var, suffix = "foo") {
    +  var <- enquo(var)
    +  prefix <- as_label(var)
    +  data %>%
    +    summarise("{prefix}_mean_{suffix}" := mean(!!var))
    +}

    Expressions defused with enquo() (or tunnelled with {{) need not be simple column names, they can be arbitrarily complex. as_label() handles those cases gracefully. If your code assumes @@ -208,7 +208,7 @@

    Tidy eval helpers

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.7.