[R-pkg-devel] html from Rd

2015-09-14 Thread Erich Subscriptions
I am converting an Rd file to html.
I am furthermore using the html file produced as input for producing a ch, file.
And the user experience could be improved it there were a way to embed names 
like
 
into the html file produced.
Is there a way of accomplishing this?

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


Re: [R-pkg-devel] html from Rd

2015-09-14 Thread Duncan Murdoch

On 14/09/2015 11:24 AM, Erich Subscriptions wrote:

I am converting an Rd file to html.
I am furthermore using the html file produced as input for producing a ch, file.
And the user experience could be improved it there were a way to embed names 
like

into the html file produced.
Is there a way of accomplishing this?


I think this is more of an R-devel topic, but the answer is "yes, 
several ways, none very simple".


The way I'd do it is to split up the parse_Rd() step from the Rd2HTML() 
step, and add the extra bit to the parsed version.


Another way to do it would be to edit the input file before conversion, 
or the output file after conversion.  The latter is probably easier 
because the output is a little more predictable.


Duncan Murdoch

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


[R-pkg-devel] Return Value of By Function

2015-09-14 Thread Dario Strbenac
Good day,

I am curious why the by function result has dimensions attached, even when it 
returns a list.

result <- by(warpbreaks[, 1],   warpbreaks[, -1], summary)
str(result)

List of 6
...
- attr(*, "dim")= int [1:2] 2 3
 - attr(*, "dimnames")=List of 2
  ..$ wool   : chr [1:2] "A" "B"
  ..$ tension: chr [1:3] "L" "M" "H"

Also, why does looking at the top of the list remove the names ?

> head(result, 3)
[[1]]
   Min. 1st Qu.  MedianMean 3rd Qu.Max. 
  25.00   26.00   51.00   44.56   54.00   70.00 

[[2]]
   Min. 1st Qu.  MedianMean 3rd Qu.Max. 
  14.00   20.00   29.00   28.22   31.00   44.00 

[[3]]
   Min. 1st Qu.  MedianMean 3rd Qu.Max. 
 12  18  21  24  30  36

Compared to :

> result
wool: A
tension: L
   Min. 1st Qu.  MedianMean 3rd Qu.Max. 
  25.00   26.00   51.00   44.56   54.00   70.00 
...

I can't tell which list entry is for which combination of factors, after it is 
accessed. It would be great if it was easier to get the factor levels used for 
each list element, perhaps as a data.frame.

--
Dario Strbenac
PhD Student
University of Sydney
Camperdown NSW 2050
Australia

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