I would like to dynamically create a variable name from a string and then assign in a value. I believe I should be able to easily do this with {rlang} but haven't been able to work it out from package docs, Advanced R, and searching. Below is a pseudo-reprex of what I'm looking for. Thank you for your guidance!
My desired output: answer <- 42
My input: x <- "answer" (except that "answer" is generated and not hardcoded in the script)
Attempt: rlang::sym(x) <- 42