Seeing an odd R code execution error in RStudio

So this only seems to happen when I'm writing a new function in a script and typing out one of the params of the function, but I'm seeing this error pop up with the autocomplete in this specific scenario:


In the console, for every character I type, it'll return the following error:

Error in if (length(object)) { : argument is of length zero

Here's how it looks in console:


Anyone have any idea why this is happening? It's not super disruptive, just weird. Once I write the function to the environment the issue goes away until I start writing a new function.

Screenshots are not very helpful. See the FAQ: How to do a minimal reproducible example reprex for beginners. It's easiest to provide help by being able to share the pain.

Unfortunately (or I guess, fortunately), there’s nothing wrong with any of the code I’m writing, just that the IDE’s autocomplete! I’d supply a reprex otherwise

Still need to be able to see what's going on, both figuratively and literally. Your avatar shows vision correction. Can you make out the function without them? At about age 40, many peeps develop presbyopia. By co-incidence the last millennials turn 40 this month. This severely limits the population of peeps potentially able to help.

Beyond the mild tongue-in-cheek, can you share the function and we can compare results?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.