Not exactly a game-breaking bug, but I was curious on how people generally would deal with this.
I have set a list variable that is initialised with a default value of NA. But, this value gets replaced with a list (so list within a list) if the user sets the value.
So when I put this into an if statement, it will only check for the first element in the list:
if (!is.na(list1$list2)) {
...
}
# the condition has length > 1 and only the first element will be used
So the potential problem is if the first element is, by off chance, NA. It won't be 99% of the time, but I'm trying to prevent the exception.
I just want to check if the variable has been altered or not from the initial state. What would be the right solution for this?