There has been a little bit of discussion before of warnings carrying over in unexpected ways, sometimes possibly linked to the fact that RStudio is calling some bits of R code behind the scenes. See:
And I could swear I read a more involved discussion of this here or on the Github issue tracker, including an attempted fix, but I can't find it now (and maybe I imagined it!). As usual, if you can confirm that this happens only in RStudio and not in R, and find a way to reproduce the out-of-place (or just confusingly placed) warnings, that would be helpful!