Thomas Lumley 6/23/2022

Getting strings into code in base R

Read Original

This technical article addresses a common R programming challenge: using the value of a character string as a variable name in code, particularly within model formulas. It contrasts the fragile approach using `paste()` with the more robust `bquote()` function for quasiquotation, demonstrating its application with the `survey` package's `svyglm` function.

Getting strings into code in base R

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

1
The Beautiful Web
Jens Oliver Meiert 2 votes
3
LLM Use in the Python Source Code
Miguel Grinberg 1 votes
4
Wagon’s algorithm in Python
John D. Cook 1 votes