[Rd] legitimate use of :::

Brian Lee Yung Rowe rowe at muxspace.com
Fri Aug 23 02:37:23 CEST 2013


This is what I was getting at as well. It would be great to have a call like

require(package, c('funtion.1','function.2')) 

or similar that gives users granular control over what gets imported in the shell. I would be drunk with joy if the same mechanism could be used to automatically populate the package directives.


On Aug 22, 2013, at 8:01 PM, Peter Meilstrup <peter.meilstrup at gmail.com> wrote:

> It would be nice if the functionality of importFrom() and import() were
> available to user level code, rather than just to people building packages
> for distribution. One most often encounters namespace conflicts at the user
> level, when loading two packages that have no logical connection other than
> both bearing on your problem of the moment.
> 
> R conflates "having namespaces" with "having a library distribution
> mechanism" and while its library distribution mechanism is top notch, most
> modern languages do not require you to learn the distribution procedure in
> order to just have namespaces.
> 
> For instance, in Python you merely put code in a file called foo.py and
> then in any other file in the same directory you type "import functionName
> from foo". I.E. using namespaces does not require you to build/install
> packages. Python namespaces are also hierarchical so that the question of
> this thread would easily be resolved by putting functions into
> foo._internal and in other packages typing import * from "foo._internal"
> 
> Peter
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list