JosiahParry / quarto-site

attempting to build a new site using quarto
2 stars 2 forks source link

posts/2024-06-13-eval-strings #15

Open utterances-bot opened 6 days ago

utterances-bot commented 6 days ago

Josiah Parry - Evaluate strings as code

https://josiahparry.com/posts/2024-06-13-eval-strings

yihui commented 6 days ago

I think the best solution was given by @klmr:

getExportedValue('dplyr', 'starwars')

IHMO eval() should really be used as the very last resort. In most cases, there may exist a cleaner and safer way to achieve the task.

BTW, I'm not sure if there's any benefit of using {rlang} vs eval(parse(text = dataset_str)).