Why is it so common to see library(packages) in r but using * to load all functions in a package is bad python practice?

Viewed 50

As someone with a background in Python coming to R, every time that I use library(<package name>) syntax, I feel like cutting my finger with a paper!! Because I believe anyone who has learned python as their first language knows that they shouldn't use from <package> import * syntax as much as possible.

  • So, why most people in R community use library() to import everything instead of relying on package::function syntax which is equivalent to package.function in python. Aren't they thinking of their namespace?
  • The fact that I see tidyverse complaining about namespace conflicts is evidence that R compiler doesn't have some magical intuition to understand from which package your desired function is, they why do they practice that?

Do you recommend using library() or package::function syntax in R?

0 Answers
Related