[R] Where is a package NEWS.Rd located?
Niels Richard Hansen
Niels.R.Hansen+lists at math.ku.dk
Sat Jan 8 05:30:35 CET 2011
Dear Kevin
Just had the same "problem", that is, placed the NEWS.Rd in
the package inst/ directory, and the news() function did not
find the information. The help page for news() is, however,
pretty clear:
"..., if the given add-on package can be found
in the given libraries, it is attempted to read its news in
structured form from files 'inst/NEWS.Rd', 'NEWS' or 'inst/NEWS'
(in that order)."
Hence, installing NEWS.Rd in an inst/ directory works fine.
I have no idea if an installed package should or shouldn't have
an inst/ subdirectory, but from the help page the functionality
seems intentional to me.
- Niels
On 06/01/11 12.35, Kevin Wright wrote:
> Andy, thanks for providing a clear way of saying it. I thought I was
> clear in the first place, but oh well).
>
> Here is the structure of my source files:
>
> hwpkg/DESCRIPTION
> hwpkg/R/hw.R
> hwpkg/inst/NEWS.Rd
>
> I'm using Windows XP. When I install this package, I do this:
>
> Rcmd INSTALL hwpkg
>
> Which results in
>
> ls c:/r/r-2.12.0/library/hwpkg/
> -rwxr-x---+ 1 wrightkevi 355 Jan 6 14:19 DESCRIPTION
> drwxrwx---+ 2 wrightkevi 0 Jan 6 14:19 Meta
> -rwxr-x---+ 1 wrightkevi 18 Jan 6 14:19 NEWS.Rd
> drwxrwx---+ 2 wrightkevi 0 Jan 6 14:19 R
> drwxrwx---+ 2 wrightkevi 0 Jan 6 14:19 help
> drwxrwx---+ 2 wrightkevi 0 Jan 6 14:19 html
>
> As you see, there is no "inst/NEWS.Rd" file (NEWS.Rd has been moved UP
> a level), and so news(package="hwpkg") returns nothing.
>
> If I build the package into a zipfile and then
> install.packages(zipfile), the same problem occurs.
>
> Kevin
>
>
> On Thu, Jan 6, 2011 at 2:06 PM, Liaw, Andy<andy_liaw at merck.com> wrote:
>> I was communicating with Kevin off-list.
>>
>> The problem seems to be run time, not install time. News() calls
>> tools:::.build_news_db(), and the 2nd line of that function is:
>>
>> nfile<- file.path(dir, "inst", "NEWS.Rd")
>>
>> and that's the problem: an installed package shouldn't have an inst/
>> subdirectory, right?
>>
>> Andy
>>
>>
>>> -----Original Message-----
>>> From: r-help-bounces at r-project.org
>>> [mailto:r-help-bounces at r-project.org] On Behalf Of Duncan Murdoch
>>> Sent: Thursday, January 06, 2011 2:30 PM
>>> To: Kevin Wright
>>> Cc: R list
>>> Subject: Re: [R] Where is a package NEWS.Rd located?
>>>
>>> On 06/01/2011 2:19 PM, Kevin Wright wrote:
>>>> Yes, exactly. But the problem is with NEWS.Rd, not NEWS.
>>>
>>> I'm not sure who you are arguing with, but if you do file a
>>> bug report,
>>> please also put together a simple reproducible example, e.g. a small
>>> package containing NEWS.Rd in the inst directory (which is where the
>>> docs say it should go) and code that shows why this is bad.
>>> Don't just
>>> talk about internal functions used for building packages; as
>>> far as we
>>> can tell so far tools:::.build_news_db is doing exactly what
>>> it should
>>> be doing.
>>>
>>> Duncan Murdoch
>>>
>>>> pkg/inst/NEWS.Rd is moved to pkg/NEWS.Rd at build time, but for
>>>> installed packages, "news" tried to load "pkg/inst/NEWS.Rd".
>>>>
>>>> I'm going to file a bug report.
>>>>
>>>> Kevin
>>>>
>>>>
>>>> On Thu, Jan 6, 2011 at 7:29 AM, Kevin
>>> Wright<kw.stat at gmail.com> wrote:
>>>>> If you look at tools:::.build_news_db, the plain text
>>> NEWS file is
>>>>> searched for in pkg/NEWS and pkg/inst/NEWS, but NEWS.Rd in only
>>>>> searched for in pkg/inst/NEWS.Rd.
>>>>>
>>>>> Looks like a bug to me.
>>>>>
>>>>> I *think*.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Kevin
>>>>>
>>>>>
>>>>> On Thu, Jan 6, 2011 at 7:09 AM, Kevin
>>> Wright<kw.stat at gmail.com> wrote:
>>>>>> Hopefully a quick question. My package has a NEWS.Rd
>>> file that is not
>>>>>> being found by "news".
>>>>>>
>>>>>> The "news" function calls "tools:::.build_news_db"
>>> which has this line:
>>>>>>
>>>>>> nfile<- file.path(dir, "inst", "NEWS.Rd")
>>>>>>
>>>>>> So it appears that the "news" function is searching for
>>>>>> "mypackage/inst/NEWS.Rd".
>>>>>>
>>>>>> However, "Writing R extensions" says "The contents of the inst
>>>>>> subdirectory will be copied recursively to the
>>> installation directory"
>>>>>>
>>>>>> During the installation, mypackage/inst/NEWS.Rd is
>>> copied into the
>>>>>> "mypackage" directory, not "mypackage/inst".
>>>>>>
>>>>>> What am I doing wrong, or is this a bug?
>>>>>>
>>>>>> Kevin Wright
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Kevin Wright
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Kevin Wright
>>>>>
>>>>
>>>>
>>>>
>>>
>>> ______________________________________________
>>> R-help at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide
>>> http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>> Notice: This e-mail message, together with any attachments, contains
>> information of Merck& Co., Inc. (One Merck Drive, Whitehouse Station,
>> New Jersey, USA 08889), and/or its affiliates Direct contact information
>> for affiliates is available at
>> http://www.merck.com/contact/contacts.html) that may be confidential,
>> proprietary copyrighted and/or legally privileged. It is intended solely
>> for the use of the individual or entity named on this message. If you are
>> not the intended recipient, and have received this message in error,
>> please notify us immediately by reply e-mail and then delete it from
>> your system.
>>
>>
>
>
>
--
Niels Richard Hansen Web: www.math.ku.dk/~richard
Associate Professor Email: Niels.R.Hansen at math.ku.dk
Department of Mathematical Sciences nielsrichardhansen at gmail.com
University of Copenhagen Skype: nielsrichardhansen.dk
Universitetsparken 5 Phone: +1 510 502 8161
2100 Copenhagen Ø
Denmark
More information about the R-help
mailing list