Re: [Rd] \link{} to help pages in Debian

2004-12-01 Thread Iago Mosqueira
On Wed, 2004-12-01 at 07:38, Prof Brian Ripley wrote:

 That's guaranteed by the R install scripts, just by following `Writing R 
 Extensions'.  *If* it is not working for you, you are doing something 
 which you are not telling us.

Well, I am simply following as much as my, probably limited,
understanding allows. I am using a stock Debian install, r-base and
other packages from debian, and extra packages from CRAN. My package
follows, as far as I can tell, the manual. If I am doing something else
I am not conscious of it.

 Ah, but that is not what you actually said (an example of the lack of 
 clarity).

At least that´s what I tried to do. 

 I still don't know if you are imagining that there might be a problem that 
 you want to write a package to avoid, or that you have a current problem. 

I´ll rather use my imagination for something else. This is a problem
with my own package, that in fact passes R CMD check.

 If the latter, please start again with the full details: which packages, 
 the commands you used to install them, what happens and what the links in 
 the html file concerned are.

Here we go: The package concerned is my own, which passes check fine. I
include \code{\link{plot.default}} in a help page. After R CMD INSTALL
this page gets installed in

 /usr/local/lib/R/site-library/mypackage/html/page.html 
and when clicking on the plot.default link, it points to

 /usr/local/lib/R/site-library/graphics/html/plotdefault.html

 instead of

/usr/lib/R/library/graphics/html/plotdefault.html

where in fact lives.

Both locations appear with .libPaths().

Any other information that can be of help?

Cheers,


Iago Mosqueira

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] \link{} to help pages in Debian

2004-12-01 Thread Prof Brian Ripley
On Wed, 1 Dec 2004, Iago Mosqueira wrote:
On Wed, 2004-12-01 at 07:38, Prof Brian Ripley wrote:
That's guaranteed by the R install scripts, just by following `Writing R
Extensions'.  *If* it is not working for you, you are doing something
which you are not telling us.
Well, I am simply following as much as my, probably limited,
understanding allows. I am using a stock Debian install, r-base and
other packages from debian, and extra packages from CRAN. My package
follows, as far as I can tell, the manual. If I am doing something else
I am not conscious of it.
Ah, but that is not what you actually said (an example of the lack of
clarity).
At least that´s what I tried to do.
I still don't know if you are imagining that there might be a problem that
you want to write a package to avoid, or that you have a current problem.
I´ll rather use my imagination for something else. This is a problem
with my own package, that in fact passes R CMD check.
If the latter, please start again with the full details: which packages,
the commands you used to install them, what happens and what the links in
the html file concerned are.
Here we go: The package concerned is my own, which passes check fine. I
include \code{\link{plot.default}} in a help page. After R CMD INSTALL
this page gets installed in
/usr/local/lib/R/site-library/mypackage/html/page.html
and when clicking on the plot.default link, it points to
/usr/local/lib/R/site-library/graphics/html/plotdefault.html
instead of
/usr/lib/R/library/graphics/html/plotdefault.html
where in fact lives.
Both locations appear with .libPaths().
Any other information that can be of help?
I asked for  `what the links in the html file concerned are', so, yes, the 
information I asked for would help.

It should be a relative link like
codea href=../../stats/html/optim.htmloptim/a/code
Under Linux, all HTML links are created to the per-session directory and 
not to the original locations.

I think you are expecting to be able to open the installed html file 
directly in a browser and get the links to work.  That's what you have not 
told us you were doing, and you won't find it documented anywhere in the R 
documentation.  (Ironically, it does work under Windows with a separate 
library tree.)

To view R HTML documentation you need to use help.start().  (Otherwise
help(foo, htmlhelp=TRUE) will warn about possible incorrect links.)
Try the documented way
Start R
help.start()
help(page)
and the links will be correct, I am pretty sure.
--
Brian D. Ripley,  [EMAIL PROTECTED]
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, UKFax:  +44 1865 272595__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] \link{} to help pages in Debian

2004-12-01 Thread Iago Mosqueira
On Wed, 2004-12-01 at 08:24, Prof Brian Ripley wrote:

 Under Linux, all HTML links are created to the per-session directory and 
 not to the original locations.

This is the key, many thanks. Maybe a mention of the mechanism on the
administration manual could be of help?

 I think you are expecting to be able to open the installed html file 
 directly in a browser and get the links to work.  

Indeed.

  and you won't find it documented anywhere in the R 
 (Ironically, it does work under Windows with a separate 
 library tree.)

That irony was puzzling me, of course. That was the reason I mentioned a
non-Debian install.

 and the links will be correct, I am pretty sure.

Not all of them. help-links.sh has problems with the permission of,
among others /usr/lib/R/doc/html/R.css. But this might be, this time, a
debian installation problem.


Cheers,


Iago

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] regex to match word boundaries

2004-12-01 Thread Gabor Grothendieck


Can someone verify whether or not this is a bug.

When I substitute all occurrence of \\B with X
R seems to correctly place an X at all non-word boundaries
(whether or not I specify perl) but \\b does not seem to
act on all complement positions:

 gsub(\\b, X, abc def) # nothing done
[1] abc def
 gsub(\\B, X, abc def) # as expected, I think
[1] aXbXc dXeXf
 gsub(\\b, X, abc def, perl = TRUE) # not as expected
[1] abc Xdef
 gsub(\\B, X, abc def, perl = TRUE)  # as expected
[1] aXbXc dXeXf
 R.version.string  # Windows 2000
[1] R version 2.0.1, 2004-11-27

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] regex to match word boundaries

2004-12-01 Thread Martin Maechler
 Gabor == Gabor Grothendieck [EMAIL PROTECTED]
 on Wed,  1 Dec 2004 21:05:59 -0500 (EST) writes:

Gabor Can someone verify whether or not this is a bug.

Gabor When I substitute all occurrence of \\B with X R
Gabor seems to correctly place an X at all non-word
Gabor boundaries (whether or not I specify perl) but \\b
Gabor does not seem to act on all complement positions:

 gsub(\\b, X, abc def) # nothing done
Gabor [1] abc def
 gsub(\\B, X, abc def) # as expected, I think
Gabor [1] aXbXc dXeXf
 gsub(\\b, X, abc def, perl = TRUE) # not as
 expected
Gabor [1] abc Xdef
 gsub(\\B, X, abc def, perl = TRUE) # as expected
Gabor [1] aXbXc dXeXf
 R.version.string # Windows 2000
Gabor [1] R version 2.0.1, 2004-11-27

I agree this looks unfortunate.

Just to confirm: 
1) I get the same on a Linux version
2) the real perl does behave differently and as
   you (and I) would have expected:

 $ echo 'abc def'| perl -pe 's/\b/X/g'
 XabcX XdefX
 $ echo 'abc def'| perl -pe 's/\B/X/g'
 aXbXc dXeXf


Also, from what I see, \b should behave the same independently
of perl = TRUE or FALSE.

--
Martin

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel