Re: [Rd] S4 class slot name 'names' is not allowed (PR#8768 S4Methods)

2006-06-15 Thread marsh
Hello,

Besides the problem with using "names," one has a similar problem using
".Data" together with "VIRTUAL." 

Consider the top of p. 295 of the green book. This should work (I had to
change "structure" to "junk" because "structure" is a sealed class
definition):

   setClass("junk",
representation(.Data="vector",VIRTUAL))

but this is what one gets

  setClass("junk",
+ representation(.Data="vector",VIRTUAL))
Error in representation(.Data = "vector", VIRTUAL) : 
object "VIRTUAL" not found

Now consider p. 5 of "S4 Classes in 15 pages, more or less." This should
work:

setClass("myVclass", representation(a = "character", "VIRTUAL"))

and indeed it does:

setClass("myVclass", representation(a = "character", "VIRTUAL"))
[1] "myVclass"

The need to quote "VIRTUAL" is the first bug, but read on.

Now take the above example, and change the first slot's name to ".Data."
Now, one gets:

setClass("myVclass", representation(.Data = "character", "VIRTUAL"))
Error in makePrototypeFromClassDef(properties, ClassDef, immediate,
where) : in constructing the prototype for class "myVclass": prototype has
class "list", but the data part specifies class "character"

So "names" is not the only problematic slot name.

Marshall Feldman

Dr. Marshall Feldman
Acting Director of Research and Academic Affairs
Center for Urban Studies and Research 
The University of Rhode Island
80 Washington Street
Providence, RI 02903-1819
email: marsh @ uri.edu (remove spaces) 
telephone: (401) 277-5218
fax: (401) 277-5099

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


[Rd] Possible To Enable Building R With Cairo But Without X11 Dependencies?

2018-07-25 Thread Stephen Marsh
Hello,

So the Homebrew community dropped support for --with-cairo which is a shame
because --without-x --with-cairo is an important combination for any
environment that might need to generate graphics without X11 (or related)
dependencies (macOS, headless linux servers).

This rejected GitHub PR contains more detail:
https://github.com/Homebrew/homebrew-core/pull/24094

(See also these comments:
https://github.com/uluyol/homebrew-core/commit/c377e6ebb3c7bc8fe6edf098e259d76e9935aacf
)

Specifically:

“It looks like the only issue is their configure scripts using cairo-xlib.h
instead of cairo.h, but to be honest I'm not familiar with the code. If
they remove the dependency, I think the default homebrew R could probably
enable cairo by default.”

I suppose my general questions are:
1) Is this actually the case? You cannot successfully build R with Cairo
capabilities but without X11 dependencies?
2) If so, is it possible to fix this in a future release of R?

Thanks a lot,
-Stephen Marsh

[[alternative HTML version deleted]]

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


Re: [Rd] Possible To Enable Building R With Cairo But Without X11 Dependencies?

2018-07-29 Thread Stephen Marsh
Thanks for the reply, Dirk.  It sounds like xvfb-run is a great solution
when you want R to assume an X window system is present but isn’t?

I think what I'm trying to figure out, and propose for the community to
possibly fix, is slightly different than would be solved by xvfb-run.

I'm wondering if --with-cairo presents a design flaw (maybe an abstraction
inversion https://en.wikipedia.org/wiki/Abstraction_inversion) wherein the
window system is taken for granted to be X and there is no way to change
it/use Cairo differently?

This has at least two consequences that I understand:
  - Most importantly, it makes --with-cairo silently incompatible with
--without-x.  If this is really intended, I think it should at least raise
a warning?
  - I think it also means, (as far as I know, but could well be wrong),
that there is not a way to use R where you rely solely Cairo’s rendering
abilities to replace the complexity of needing a specific window system
present? (This is my use case -- use cairo so R can be agnostic about a
window system).

Given that the earlier conversations made a fix sound rather trivial (use
cairo.h instead of cairo-xlib.h), I’m wondering if there is a path to
getting that implemented?

Thanks a lot,
-Stephen Marsh

On Wed, Jul 25, 2018 at 9:35 PM, Dirk Eddelbuettel  wrote:

>
> On 25 July 2018 at 21:04, Stephen Marsh wrote:
> | So the Homebrew community dropped support for --with-cairo which is a
> shame
> | because --without-x --with-cairo is an important combination for any
> | environment that might need to generate graphics without X11 (or related)
> | dependencies (macOS, headless linux servers).
>
> For headless use on Linux, just build as usual and run via `xvfb-run`. If
> you
> need to create cairo-based graphics, install one of the (at least two)
> cairo
> device packages from CRAN.
>
> Dirk
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
>



-- 
stephenmarsh.co

[[alternative HTML version deleted]]

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


[Rd] Small Fix: Greatly Increase Clarity/Utility of R Package Help/Manual Overview Pages

2021-06-29 Thread Marsh, Samuel
?Hi,


I would like to suggest a single line (2 characters) fix that I feel would 
greatly improve the readability and usefulness of the overview R package 
help/manual pages.  Currently the overall help/manual page for a package is 
organized into alphabetized table of contents with linked headers by letter 
only if the package contains more than 100 functions, otherwise the functions 
are simply listed with no line breaks.  This makes for a more difficult user 
experience with moderately sized packages 50-99 functions that could be 
improved.  I would suggest changing the threshold for creating this 
alphabetized table of contents to 50 instead of 100.


I've provided info on the current code that specifies this parameter below:

It would appear that all that needs to be changed is the "> 100" parameter on 
this line:
https://github.com/wch/r-source/blob/80a7ca3b605b34d207ed3465c942f39a37e89f6e/src/library/tools/R/install.R#L2770


Or to list the code directly:

In the .writePkgIndices function the line is:
use_alpha <- (nrow(M) > 100)?


It appears to me the only change needed would be to set "nrow(M) > 50".  I 
believe this very small fix would greatly improve user experience for a growing 
number of moderately-sized packages whose manual/help pages would still greatly 
benefit from greater readability/organization.


Thank you!

Sam


--
Samuel E. Marsh, Ph.D.
Postdoctoral Fellow
Laboratory of Dr. Beth Stevens
F.M. Kirby Neurobiology Research Center
Boston Children's Hospital
Harvard Medical School
samuel.ma...@childrens.harvard.edu

[[alternative HTML version deleted]]

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