[Rd] Accessing Package NEWS (NEWS.Rd)

2011-02-19 Thread Paul Roebuck
Okay. So, after having spent quite some time never really tracking down
why my package NEWS files were unacceptable to readNEWS(), I
noticed that there was recent (to me anyway) development that allowed
the NEWS to be done as an Rd file. Sweet! A more standard format...

I converted a NEWS file in one of my unreleased packages to Rd format.
checkNEWS() gave it a thumbs up.

But then it went south. Tried the following after installation:

 checkNEWS(myapp/trunk/MyApp/inst/NEWS.Rd)
[1] TRUE
 news(package=MyApp)

Nothing.

Debugging news() itself left me wondering. The first thing checked
for was 'inst/NEWS.Rd' - once I install the package, that would never
exist though, right? Should tools:::.build_news_db() instead use:

nfile - file.path(dir, c(NEWS.Rd, file.path(inst, NEWS.Rd)))

On the slim chance it should, I modified the path to my
source folder's copy and continued debugging into 
tools:::.build_news_db_from_package_NEWS_Rd().


debug: ind - grepl(re_v, nms, ignore.case = TRUE)
Browse[2] 
debug: if (!all(ind)) warning(Cannot extract version info from the following 
section titles:\n, 
Browse[2] ind
[1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
Browse[2] 
debug: NULL
Browse[2] 
debug: .make_news_db(cbind(ifelse(ind, sub(re_v, \\1, nms), NA_character_), 
ifelse(grepl(re_d, nms), sub(re_d, \\1, nms), NA_character_), 
db[, 2L], sub(\n*$, , db[, 3L])), logical(nrow(db)), 
news_db_from_Rd)
Browse[2] 
debugging in: .make_news_db(cbind(ifelse(ind, sub(re_v, \\1, nms), 
NA_character_), 
ifelse(grepl(re_d, nms), sub(re_d, \\1, nms), NA_character_), 
db[, 2L], sub(\n*$, , db[, 3L])), logical(nrow(db)), 
news_db_from_Rd)
debug: {
out - data.frame(x, row.names = NULL, stringsAsFactors = FALSE)
colnames(out) - c(Version, Date, Category, Text)
if (!is.null(bad)) 
attr(out, bad) - bad
class(out) - unique(c(classes, news_db, data.frame))
out
}
Browse[3] 
debug: out - data.frame(x, row.names = NULL, stringsAsFactors = FALSE)
Browse[3] 
debug: colnames(out) - c(Version, Date, Category, Text)
Browse[3] 
debug: if (!is.null(bad)) attr(out, bad) - bad
Browse[3] 
debug: attr(out, bad) - bad
Browse[3] 
debug: class(out) - unique(c(classes, news_db, data.frame))
Browse[3] 
debug: out
Browse[3] 
exiting from: .make_news_db(cbind(ifelse(ind, sub(re_v, \\1, nms), 
NA_character_), 
ifelse(grepl(re_d, nms), sub(re_d, \\1, nms), NA_character_), 
db[, 2L], sub(\n*$, , db[, 3L])), logical(nrow(db)), 
news_db_from_Rd)
exiting from: tools:::.build_news_db_from_package_NEWS_Rd(newsfile)
Error: invalid version specification CHANGES IN VERSION 1.0.0CHANGES IN VERSION 
1.0.1CHANGES IN VERSION 2.0.0


Well, so it didn't like my version numbers. But is the regexp check correct?

Browse[2] .standard_regexps()$valid_package_version
[1] ([[:digit:]]+[.-]){1,}[[:digit:]]+

Would appear as though packages with only major.minor comparisons would
pass. Or did I miss something...



P.S. Another thing I didn't see specified was whether this was an acceptable 
format
in current Rd format:

\section{CHANGES IN VERSION 2.0.0}{

Trying to get original TEXT files to be read by readNEWS(), the sections had to
read CHANGES IN R VERSION nnn. Using Rd format, checkNEWS() seemed
to allow optionally using a package name instead (of 'R'). As it also allowed 
using
nothing, i went with that. What's the intended canonical format?

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Set up new CRAN mirror; but have questions before finalizing.

2011-02-19 Thread Henrik Bengtsson
On Fri, Feb 18, 2011 at 10:43 PM, Friedrich Leisch
friedrich.lei...@stat.uni-muenchen.de wrote:
 On Fri, 18 Feb 2011 22:00:28 -0600,
 Paul Johnson (PJ) wrote:

   Hi, everybody
   I have an account on Dreamhost.com and when I renewed it recently,
   their message said my usage of storage and bandwidth had been
   reasonably low. In an idle moment about 3 weeks ago, I followed your
   instructions to set up a CRAN mirror on their server.  Here it is:

   http://www.freefaculty.org/cran

   It is not hosted at my University, but it is a working, high
   availability server.  Is there any reason it could not be listed as a
   CRAN mirror. (Although I really have no idea where these machines
   exist. I'm pretty sure it is in the USA. I'll try to find out).

 We would need to know where it is because we lsit mirrors in the US
 sorted by state ...

http://ipinfodb.com/ip_locator.php?ip=www.freefaculty.org

?

/Henrik



   Maybe you might try it and see?  It has updated several times, no
   trouble I can see in that.

   I have a couple of small details to ask about.  Maybe this first one
   is a potential  bug report for the CRAN mirror instructions.

   1. Permissions on src and web folders are 700,

 Then you must have made a mistake in setting up the mirror, because on
 the master we have 775 for both directories and all directories within
 these two. We also had never complaints about this before.

   and so running update.packages or an apt-get update against the
   debian stuff results in permission denied errors.  I re-set the
   permissions manually, but wonder if I'm actually supposed to mess
   around with your archive.  After doing that, it works.  But I
   worry a little bit about what else might not be readable down
   there in the hierarchy. And I wonder why any body else's mirror
   works without doing that.

 Well, they simply mirrored our permissions ...


   2. When I run apt-get update against my mirror, i get a lot of
   harassment about the lack of a security key for my repository.  Should
   I be publishing an R Core team key to fix that, or my own key to do
   what?  I've never administered an apt repository before. I have
   administered yum repositories and the security there is in the key on
   the individual RPMS, I don't quite understand what the Debian thing is
   asking me to do.

 It is quite common then non-official Debian mirrors have no security
 key, I would not worry too much about that.

 Best regards,
 Fritz Leisch

 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel


__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Set up new CRAN mirror; but have questions before finalizing.

2011-02-19 Thread Paul Johnson
On Sat, Feb 19, 2011 at 12:43 AM, Friedrich Leisch
friedrich.lei...@stat.uni-muenchen.de wrote:
 On Fri, 18 Feb 2011 22:00:28 -0600,
 Paul Johnson (PJ) wrote:

   Hi, everybody

   Maybe you might try it and see?  It has updated several times, no
   trouble I can see in that.

   I have a couple of small details to ask about.  Maybe this first one
   is a potential  bug report for the CRAN mirror instructions.

   1. Permissions on src and web folders are 700,

 Then you must have made a mistake in setting up the mirror, because on
 the master we have 775 for both directories and all directories within
 these two. We also had never complaints about this before.

Greetings, Fritz

I'm surprised too.  All I did was follow the very clear and simple
instructions in the HOWTO. I run this script in the folder where the
web server lives.
$ cat downloadCran.sh
rsync -rtlzv --delete cran.r-project.org::CRAN
/home/freefaculty/freefaculty.org/cran

I promise (sincerely) I changed nothing that forced src or web to 700.

I manually put all the directories to permission 755 and then will run
an update and see if they stay that way.  If all stays well, I'll
notify the address listed in the mirror HOWTO that this thing is in
California.

pj


 Best regards,
 Fritz Leisch




-- 
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] pre-release?

2011-02-19 Thread Göran Broström
When I install eha I get a warning:

1: package 'eha' was built under R version 2.12.2 

'eha' was installed thru 'install.packages(eha), and as far as I can see, 
version 2.12.2 is not released yet. This is on a Mac, with 2.12.1.

Göran
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] pre-release?

2011-02-19 Thread Simon Urbanek
On Feb 19, 2011, at 5:44 PM, Göran Broström wrote:

 When I install eha I get a warning:
 
 1: package 'eha' was built under R version 2.12.2 
 
 'eha' was installed thru 'install.packages(eha), and as far as I can see, 
 version 2.12.2 is not released yet. This is on a Mac, with 2.12.1.
 

This comes from the fact that the R-2.12-patched branch has moved from 2.12.1 
at the time of the beta to 2.12.2 -- (now RC BTW).

Cheers,
Simon

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Demo and 00Index problems

2011-02-19 Thread Ronald Barry
Greetings,
  I am sure I'm missing the obvious, but my 00Index file in the demo
subdirectory is not recognized by R CMD check (the demo runs fine, but
I get a WARNING from R CMD check about a lack of demo/00Index file.
When I invoke demo()  in R I see the name but not description of the
demo).  Is there documentation (other than 'Writing R extensions') on
putting together the demo subdirectory?  Thanks.

Ron Barry

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Demo and 00Index problems

2011-02-19 Thread Gabor Grothendieck
On Sat, Feb 19, 2011 at 9:57 PM, Ronald Barry rpba...@alaska.edu wrote:
 Greetings,
  I am sure I'm missing the obvious, but my 00Index file in the demo
 subdirectory is not recognized by R CMD check (the demo runs fine, but
 I get a WARNING from R CMD check about a lack of demo/00Index file.
 When I invoke demo()  in R I see the name but not description of the
 demo).  Is there documentation (other than 'Writing R extensions') on
 putting together the demo subdirectory?  Thanks.


Download the source of any existing package that has a demo/00Index file, e.g.
http://cran.r-project.org/web/packages/gsubfn/index.html


-- 
Statistics  Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] dotchart {graphics} 2.11.1 vs. 2.12.1 [followed up from Rhelp]

2011-02-19 Thread Joshua Wiley
On Fri, Feb 18, 2011 at 5:44 AM, Prof Brian Ripley
rip...@stats.ox.ac.uk wrote:
 On Tue, 1 Feb 2011, Joshua Wiley wrote:

 Dear List,

 With the R 2.12.0 addition of table methods for points(), dotchart()
 struggles with tables.

 Which of course it is not documented to accept, not even the base type of
 such tables, a 1-D array.  So this is detecting a previously undetected user
 error.

Of course, I hope my wording did not imply there was any problem or
error.  I was interested in what is the best way to make this work?


 Because the table methods of lines/points have different defaults, your
 suggestions are not going to work (did you actually try them with the
 dotchart example?).

I thought I had, but evidently not.

The best we can do is to throw an error if 'y' is
 specified in a table method.

 I found several possible solutions, but it is beyond my skill to decide
 what is best.  Here is a small example:

 dotchart(as.vector(x)) works, but is probably not what you want.
 dotchart(unclass(x)) works, but it is not guaranteed to keep working.

 Unclassing is definitely dangerous, since the test is.numeric(x) invokes a
 generic function.  If methods have been written following the help page (and
 not all have), as.numeric(x) should do the trick, but needs to be done after
 names are extracted.

I take it creating a named vector using name extraction and
as.numeric(x) is the best approach.

Thanks for the information,

Josh


 OTOH, learning the discipline of consulting the help pages if things do not
 work as you expect is a good one, since there is no way R is going to check
 all inputs to all functions.


 #
 x - table(infert$education)
 y - 1:3L

 dotchart(x) # error about incorrect plot type

 ## moving closer to the cause, dotchart() essentially does
 plot(x = c(0, 150), y = c(0, 5), type = n)
 points(x, y) # error, because arg #2 is the type

 ## One option would be to explicitly name the arguments in dotchart()
 points(x = x, y = y) # works, but misses the point (no pun intended)

 ## Another possibility would be to add unclass(). I'm not sure
 ## if this would have other repercussions.  line 71 could become:
 points(unclass(x), y, pch = pch, col = color, bg = bg)

 ## Other options could be adding a method for dotchart()
 ## or to update the table method for points()
 points.table - function (x, y, type = h, lwd = 2, ...)
 {
   if (length(dim(x)) == 1L) {
       nx - dimnames(x)[[1L]]
       is.num - suppressWarnings(!any(is.na(xx - as.numeric(nx
       x0 - if (is.num)
           xx
       else seq.int(x)
       if (missing(y)) {
         points(x0, unclass(x), type = type, lwd = lwd, ...)
       } else points(unclass(x), y, type = type, lwd = lwd, ...)
   }
   else stop(only for 1-D table)
 }

 plot(x = c(0, 150), y = c(0, 5), type = n)
 points(x, y, type = p)

 #



 --
 Joshua Wiley
 Ph.D. Student, Health Psychology
 University of California, Los Angeles
 http://www.joshuawiley.com/

 --
 Brian D. Ripley,                  rip...@stats.ox.ac.uk
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford,             Tel:  +44 1865 272861 (self)
 1 South Parks Road,                     +44 1865 272866 (PA)
 Oxford OX1 3TG, UK                Fax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel