LoginSignup
3
0
この記事誰得? 私しか得しないニッチな技術で記事投稿!

R言語ではqualified nameを使えばlibrary()は必要ない

Posted at

以下の2つは同じ意味となる。

library(ggplot2)
gp = ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, colour=Species)) + geom_point(size = 3, alpha = 0.7)
print(gp)
gp = ggplot2::ggplot(iris, ggplot2::aes(x = Sepal.Length, y = Sepal.Width, colour=Species)) + ggplot2::geom_point(size = 3, alpha = 0.7)
print(gp)

library()はPythonで言うところのimport *に近いのだろうか。

それにしても、この機能についてはドキュメントが一切見当たらなく、 知ったのはR言語を初めて触ってから15年後 のことである…。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0