List,
I want to add a color legend to a heatmap , similar to the one in levelplot
and filled.contour plot. The legend should contain the colors used in the
heatmap along with values for each color range. Can this be done? Please
help.
Thanks,
Akkineni.
[[alternative HTML version deleted]
On 14 Feb 2006, [EMAIL PROTECTED] wrote:
> It seems to me like the generic should (always?) just have arguments
> used for dispatch -- stream, in this case -- and that methods then
> specify default values.
There are advantages to adding named arguments to a generic to define
the expected interf
Echoing similar suggestions, but with a bit of philosophy... How about:
setGeneric("rstream.sample",
function( stream, ... ) standardGeneric("rstream.sample"))
setMethod("rstream.sample", c( "numeric" ),
function( stream, n = 1, ... ) { code } )
It seems to me like the gene
The problem is not the optional argument, but the attempt to dispatch on
an argument not in the generic.
setGeneric("rstream.sample", function(stream, ...)
standardGeneric("rstream.sample"))
setMethod("rstream.sample", "rstream", function(stream,n=1) { print(n) } )
rstream.sample(rs,
Hi Josef,
On 14 Feb 2006, [EMAIL PROTECTED] wrote:
> I have used a construct to allow optional arguments:
>
> if(!isGeneric("rstream.sample")) setGeneric("rstream.sample",
> function(stream,...) standardGeneric("rstream.sample"))
First, a question:
Is this idiom of testing for the generic befor
Hi,
i have used S4 classes to implement a unified access to random number generators
(package rstream on CRAN).
I have used a construct to allow optional arguments:
if(!isGeneric("rstream.sample"))
setGeneric("rstream.sample", function(stream,...)
standardGeneric("rstream.sample"))
set
On Mon, 13 Feb 2006, J. Hosking wrote:
> > addmargins(UCBAdmissions, FUN = list(Total=sum))
>
> works with no problems, but consider:
>
> > myFUN <- list(Total=sum)
> > addmargins(UCBAdmissions, FUN = myFUN)
> Error in "names<-.default"(`*tmp*`, value = "") :
> names() applied to a non-vec
On 2/13/06, Prof Brian Ripley <[EMAIL PROTECTED]> wrote:
> I believe the bug is triggered by the fairly unusual event you have a '.'
> in the package name, and the change in 2.2.1 to 2.2.1 patched was to add
>
> > LIBRARY R.native.dll
>
> (which is what my workaround in ld.e