Kathleen Weessies · @weessiek
23 followers · 55 posts · Server mapstodon.space

This is a noob's observation of R, Tidyverse and Stringr. But wow, why can some datasets open in notepad or Windows file preview or excel in 1 second but takes minutes or hours to show up in str_view_all?

, ,

#r #tidyverse #stringr

Last updated 2 years ago

One night I got bored and wanted to list out all of the and their from my {TidyDensity}

So I got to work with and some

The steps I took:

✔ use ls() to list all packages from "package:PackageName"

✔ use group_by() to group on the fns column created above

✔ use to get the formalArgs to all fns

✔ drop the c and paste0 fns, (, params and the ending )

Post: spsanderson.com/steveondata/po

#methods #Map #baser #stringr #purrr #dplyr #package #r #parameters #functions

Last updated 2 years ago

Sharon Machlis · @smach
1372 followers · 410 posts · Server fosstodon.org

The {stringr} 📦 gets a function to convert a character vector into a single, comma-separated string *with custom wording before the last item.* (I've been using knits::combine_words() for that.)

Example from the tidyverse blog post about stringr 1.5.0:

str_flatten_comma(c("cats", "dogs", "mice"), last = ", and ")

#> [1] "cats, dogs, and mice"

tidyverse.org/blog/2022/12/str

#rstats #oxfordcomma #tidyverse #stringr

Last updated 2 years ago