i need to check if an list element exists in R and if not, i need to create one. This happens inside a function.
I have a named list (currently with empty lists):
> comparisonLog
$`01-response.json`
NULL
$`02-response.json`
NULL
$`03-response.json`
NULL
$`04-response.json`
NULL
$`05-response.json`
NULL
i am interested in the third element:
elementOfInterest <- responseIterator[[3]]
> elementOfInterest
[3] "03-response.json"
Why am i getting en error here?
exists("price", where = comparisonLog[[elementOfInterest]])
Error in as.environment(where) : using 'as.environment(NULL)' is defunct
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…