[Rd] legitimate use of :::

Deepayan Sarkar deepayan.sarkar at gmail.com
Wed May 14 08:56:09 CEST 2014


On Wed, May 14, 2014 at 12:29 AM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:
> On 13/05/2014 12:14 PM, Knut Krueger wrote:
>>
>> Is there another new solution for this issue?
>> especially I would like to use:
>>
>> utils:::.win32consoleCompletion
>> the use of this is suggested in the completion.r file of utils:
>>
>> ## test some typical completion attempts
>>       library(utils)
>> testLine <- function(line, cursor = nchar(line))
>> {
>>       str(utils:::.win32consoleCompletion(line, cursor))
>> }
>>
>> testLine("")
>>
>
> I think you are misunderstanding the comments in that file.  It's an
> internal set of tests for the package, so "test some typical completion
> attempts" is a description of the tests that follow, it's not a suggestion
> that you should be able to run those lines
> from your package.
>
> If you do want access to the completion mechanism from a package, you should
> write to its author (Deepayan Sarkar) and explain the kinds of things you
> need to do.  If you can convince him that giving you access is worth the
> trouble of exposing some of it to user-level code, then he'll export a
> function for you.  (I think it's unlikely to be .win32consoleCompletion, but
> who knows.)

Yes, .win32consoleCompletion() was meant for use by the Windows GUI,
but I can see a use-case for something similar elsewhere (for example,
ESS defines something analogous).

But I don't immediately see why another R package should need this. If
you have a legitimate use, we can discuss off-list and come up with a
solution.

-Deepayan

>
> Duncan Murdoch
>
>
>> (full quote because of the age of the tread)
>>
>>
>> Kind regards Knut
>> Am 22.08.2013 20:57, schrieb Michael Friendly:
>> > On 8/22/2013 7:45 AM, Uwe Ligges wrote:
>> >>
>> >>
>> >> On 22.08.2013 07:45, Yihui Xie wrote:
>> >>> Hi,
>> >>>
>> >>> So now R CMD check starts to warn against :::, but I believe sometimes
>> >>> it is legitimate to use it when developing R packages. For example, I
>> >>> have some utils functions that are not exported but I want to share
>> >>> them across the packages that I maintain. I do not need to coordinate
>> >>> with other authors about these internal functions since I'm the only
>> >>> author and I know clearly what I'm doing, and I want to avoid copying
>> >>> and pasting the code across packages just to avoid the NOTE in R CMD
>> >>> check. What should I do in this case?
>> >>
>> >> Nothing. The way you describe above seems to be a reasonable usage, iff
>> >> you are the same maintainer who knows what is going on. Other
>> >> maintainers should not use one of your not exported (hence non API)
>> >> functions, of course.
>> >>
>> >> Uwe Ligges
>> >>
>> >>
>> >
>> > Related to this is the use of other-package unexported utility functions
>> > that don't pass Uwe's iff test, but I, as maintainer,
>> > want to use in my package.
>> >
>> > Cases in point:  in heplots, I had used stats:::Pillai, stats:::Wilks,
>> > stats:::Roy and stats:::LH for calculation in one of my functions.
>> > Similarly, I had a need to use car:::df.terms, also unexported, but
>> > don't want to ask John Fox to export it just for my use.  Uwe's
>> > reply suggests that I should not be using car:::df.terms, however.
>> >
>> > To avoid the NOTEs (which often triggers a 'pls fix' upon submission to
>> > CRAN), I simply copied/pasted these functions to my package, but this
>> > seems wasteful.
>> >
>> > -Michael
>> >
>> >
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list