That's probably a duplicate, but I couldn't find the answer anywhere...
Anyways, here's my simple problem. I am loading a yaml file in R with users metadata. After parsing the yaml with yaml::yaml.load_file
, the list looks like this:
$users
$users$`1`
$users$`1`$user
[1] "Alice"
$users$`2`
$users$`2`$user
[1] "Bob"
I can get the user with id = 1 by:
user_list$users$`1`$user
That returns:
[1] "Alice"
My question is: how can I transform a numeric 1 into this "quoted" version, so I can pass the id as a function argument that retrieves the user I want?