Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does R support multi-level namespaces?

Is it possible to have a function in R under multiple levels of namespaces?

For example, can these functions exist?

Mymath::Trig::cosine( )
A::B::C::D::foo( )
like image 528
Chris Avatar asked Oct 29 '22 04:10

Chris


1 Answers

I don't think so, because the parser doesn't even handle this syntax: a::b::c gives

Error: unexpected '::' in "a::b::"

i.e., we don't even get as far as searching for a thing in a namespace. In contrast a::b gives

Error in loadNamespace(name) : there is no package called ‘a’

like image 141
Ben Bolker Avatar answered Nov 16 '22 10:11

Ben Bolker