Sign in

Juan Luis Herrera Cortijo

@jl-herrera-cortijo.bsky.social
42 followers 58 following 32 posts

www.linkedin.com/in/jlherreracortijo #RStats #DataScience blueskyroast.com/roast/jl-herrera-c…

PostsRepliesMedia
Juan Luis Herrera Cortijo @jl-herrera-cortijo.bsky.social · 11/12/2024
R Tip: Use `.by` in `dplyr::mutate()` for group-specific transformations without `group_by()`. Just: df %>% mutate(new_var = mean(value), .by = group) No extra grouping or ungrouping needed! Learn more: www.linkedin.com/pulse/enhanc... #RStats #DataScience
linkedin.com
Enhancing Data Transformations in R with the .by Argument in dplyr::mutate
Introduction R’s dplyr package has long been a powerhouse for data manipulation, providing intuitive, pipeline-friendly verbs for common data wrangling tasks. Among these, mutate() stands out for its ...
091
Juan Luis Herrera Cortijo @jl-herrera-cortijo.bsky.social · 06/12/2024
R Tip: Keep your R script clean with `local()`. It runs code in a temporary environment so variables don’t pollute the global workspace. Perfect for quick isolation without creating a separate function! Learn more: www.linkedin.com/pulse/levera... #RStats #DataScience
linkedin.com
Leveraging local() in R Scripts for Cleaner and More Maintainable Code
Introduction When working with R scripts, it’s common to load data, define variables, or run computations that produce intermediate results. As your code base grows, you might find the global environm...
172
Juan Luis Herrera Cortijo @jl-herrera-cortijo.bsky.social · 05/12/2024
R Tip: Use the `.by` argument in `dplyr::summarise()` to group data without `group_by()`! 🚀 Example: df %>% summarise(mean_value = mean(value), .by = group) This makes your code cleaner and more concise! ✨ #RStats #DataScience www.linkedin.com/pulse/enhanc...
linkedin.com
Enhancing Data Summarization in R with the .by Argument in dplyr::summarise
Introduction Data summarization is a fundamental step in data analysis, allowing us to condense large datasets into meaningful insights. The dplyr package in R has long been a go-to tool for data mani...
050
Juan Luis Herrera Cortijo @jl-herrera-cortijo.bsky.social · 04/12/2024
R Tip: Manage internal state in your R packages using an internal environment named `"the"`! 🔒 Create it `the <- new.env(parent = emptyenv())` to store internal data without exposing it to users. Clean and robust package namespace! Inspired by Wickham & Bryan's "R Packages" 📚 #RStats #DataScience
120
Juan Luis Herrera Cortijo @jl-herrera-cortijo.bsky.social · 03/12/2024
R Tip: Embrace the modern lambda syntax `\(x)` for anonymous functions! 🚀 The old `~ .` syntax is deprecated and maintained only for backward compatibility. Using `\(x) x^2` in `purrr::map()` makes your code clearer and more intuitive. Happy coding! 🎉 #RStats #DataScience
371
Juan Luis Herrera Cortijo @jl-herrera-cortijo.bsky.social · 02/12/2024
R Tip: Choose the right purrr function! 🛠️ - Use `map(data, func)` to transform and return new data. - Use `modify(data, func)` to change elements in-place. - Use `walk(data, func)` for side effects, returning the original data invisibly. Enhance your functional programming! 🚀 #RStats #DataScience
150
Juan Luis Herrera Cortijo @jl-herrera-cortijo.bsky.social · 01/12/2024
R Tip: Handle `NULL` values easily with `rlang`'s `%||%` operator! ✨ It returns the left value if it's not `NULL`, otherwise the right value. Example: `result <- value %||% default` assigns `value` if available, or `default` if `value` is `NULL`. A concise way to set defaults! #RStats #DataScience
161
Juan Luis Herrera Cortijo @jl-herrera-cortijo.bsky.social · 30/11/2024
R Tip: Control where new columns appear using `.before` and `.after` in `dplyr::mutate()`! 🛠️ Place your new variable exactly where you want by specifying column names or positions. df %>% mutate(new_var = x + y, .before = "x") Precise control over your data frame structure! 🎯 #RStats #DataScience
1277
Juan Luis Herrera Cortijo @jl-herrera-cortijo.bsky.social · 30/11/2024
R Tip: Enhance your ggplot2 visuals with `ggnewscale::new_scale()`! 🎨 Use `new_scale()` to add multiple color or fill scales to a single plot. This allows different geoms to have their own separate color mappings. Elevate your data visualizations! 📊✨ #RStats #DataViz
042
Juan Luis Herrera Cortijo @jl-herrera-cortijo.bsky.social · 28/11/2024
R Tip: Speed up your text writing with `brio::write_lines()`! 🚀 Unlike `base::writeLines()`, `brio::write_lines()` writes UTF-8 encoded text with consistent line endings across all platforms. Ideal for cross-platform scripts and handling special characters! 🌐✍️ #RStats #DataScience
050
Juan Luis Herrera Cortijo @jl-herrera-cortijo.bsky.social · 27/11/2024
R Tip Thread: Master the .keep argument in dplyr::mutate() for cleaner data frames! 🧹 [1/5]The .keep parameter in dplyr::mutate() lets you control which variables are retained after mutation. This can simplify your data frames and make your code more efficient. Let's explore it! #RStats #DataScience
1113
Reposted by Juan Luis Herrera Cortijo
Quarto @quarto.org · 25/11/2024
Quarto 1.6 is out! 🎉 Download it here: quarto.org/docs/download/ Quarto 1.6 supports unified branding across formats, updates to RevealJS, a new shortcode to reorder content, a landscape page block, and more. Blog post: quarto.org/docs/blog/po...
quarto.org
Quarto 1.6 – Quarto
Quarto 1.6 supports unified branding across formats, updates to RevealJS, a new shortcode to reorder content, a landscape page block, and more. There are also a couple of breaking changes that will af...
222762
Juan Luis Herrera Cortijo @jl-herrera-cortijo.bsky.social · 26/11/2024
R Tip: Clean your data effortlessly with `purrr::keep()` and `purrr::discard()`! 🧹 Use `keep(my_list, is.numeric)` to retain only numeric elements, or `discard(my_list, is.null)` to remove `NULL`s. Streamline your data processing pipelines! #RStats #DataScience
010
Juan Luis Herrera Cortijo @jl-herrera-cortijo.bsky.social · 25/11/2024
R Tip Thread: Mastering `rlang::dots_list()` and `.homonyms` for flexible function arguments! 🚀
110
Reposted by Juan Luis Herrera Cortijo
Posit @posit.co · 22/11/2024
Check out our video on parameterized report automation. Generate customized data-driven reports in minutes with Python! Part 2 of a multi-part series on Quarto & Python. Subscribe to Posit's YouTube channel to get them all. youtu.be/_kjs_u3Ctt4 #Python #pydata #quarto #DataScience
youtu.be
Generate hundreds of reports in minutes with Python & Quarto! (Parameterized report automation)
YouTube video by Posit PBC
0223
Reposted by Juan Luis Herrera Cortijo
Posit @posit.co · 21/11/2024
Introducing the mall package for running multiple LLM predictions against a data frame in #RStats or #Python! mall is inspired by the SQL AI functions offered by vendors such as Databricks and Snowflake. Learn more in this blog post by @theotheredgar.bsky.social: blogs.rstudio.com/ai/posts/202...
blogs.rstudio.com
Posit AI Blog: Introducing mall for R...and Python
We are proud to introduce the {mall}. With {mall}, you can use a local LLM to run NLP operations across a data frame. (sentiment, summarization, translation, etc). {mall} has been simultaneusly rele...
0508
Juan Luis Herrera Cortijo @jl-herrera-cortijo.bsky.social · 22/11/2024
R Tip: Automate your report generation by inserting images into Word docs with `officer::body_add_img()`! 🖼️ Use `body_add_img(doc, src = here::here("path/to/image.png"), pos = "after", width = 6, height = 4)` to add images seamlessly. Perfect for dynamic document creation! #RStats #DataScience
110
Reposted by Juan Luis Herrera Cortijo
Posit @posit.co · 20/11/2024
Want to create websites with #Quarto? @cwick.co.nz shows how to: 1. Start: www.youtube.com/watch?v=l7r2... 2. Add pages: www.youtube.com/watch?v=k65E... 3. Customize: www.youtube.com/watch?v=pAN2... 4. Add listings: www.youtube.com/watch?v=bv_C... Great for #RStats, #Python, #JuliaLang folks!
Quarto websites workshop by Charlotte Wickham. The Quarto logo is on the side.
07515
Juan Luis Herrera Cortijo @jl-herrera-cortijo.bsky.social · 21/11/2024
R Tip: Generate unique identifiers effortlessly with `uuid::UUIDgenerate()`! 🔑 Use `UUIDgenerate()` to create universally unique IDs for your data rows, ensuring no duplicates. Perfect for merging datasets or tracking records! #RStats #DataScience
051
Reposted by Juan Luis Herrera Cortijo
Posit @posit.co · 19/11/2024
We are thrilled to announce that we have a new @posit.co Starter Pack, thanks to @jeremy-data.bsky.social! Find and follow Posit people here: go.bsky.app/RxAPkGi
08935
Juan Luis Herrera Cortijo @jl-herrera-cortijo.bsky.social · 20/11/2024
R Tip: Streamline your spatial joins with `sf::st_join()` and `sf::st_within()`. 🌐 Use `st_join(points, polygons, join = st_within, left = FALSE)` to merge only the points within polygons, returning just the matching features. Efficient and tidy spatial analysis! #RStats #GIS #DataScience
1121
Reposted by Juan Luis Herrera Cortijo
Posit @posit.co · 12/11/2024
We’re excited to announce that S7 v0.2.0 is on CRAN! S7 is a new object-oriented programming (OOP) system for #RStats, collaboratively designed to supersede both S3 and S4. Shout out to the hard work of @t-kalinowski.bsky.social! Learn more in the blog post: www.tidyverse.org/blog/2024/11...
tidyverse.org
S7 0.2.0 - Tidyverse
S7 is a new package that simplifies object-oriented programming (OOP) in R. It combines the simplicity of S3 with the structure of S4 to create a clearer system that's accessible to everyone.
05911
Juan Luis Herrera Cortijo @jl-herrera-cortijo.bsky.social · 19/11/2024
R Tip: Simplify your string formatting with `glue::glue()`! 📊 Instead of multiple `paste()` functions, use `glue('Hello {name}, your score is {score}')` to embed variables directly into strings. Clean and readable code! #RStats #DataScience
170