Skip to content

"locked environment"

4 messages · Heywood, Giles, hgoehlmann@gmx.de, Barry Rowlingson +1 more

#
I have a class defined as an extension to matrix:
fooCLASS <- setClass("foo",representation("matrix"))

and define a method for a generic function (no problem):
setMethod("diff",signature(x="foo"),diff.foo <- function(x){x})

but I get a different behaviour for another generic function:
setMethod("lag",signature(x="foo"),lag.foo <- function(x){x})

Error in assign(".packageName", pkg, env) : 
can't add bindings to a locked environment

I did not get this behaviour under 1.5.1, it ran fine - any pointers?

platform i386-pc-mingw32
arch     i386           
os       mingw32        
system   i386, mingw32  
status                  
major    1              
minor    7.0            
year     2003           
month    04             
day      16             
language R              


********************************************************************** 
This is a commercial communication from Commerzbank AG.\ \ This ... {{dropped}}
#
Hello,

this might be too much to ask, but just a thought...     There are some
efforts in the bioconductor area where people create functions to produce html
tables which include links to current information. Would there be any chance
that somebody can implement a similar functionality in the pdf device, so that
you can not only create a graph but can also create a "clickable" graph with
link to current information?

Cheers,
hinrich    d8-)
#
hgoehlmann at gmx.de wrote:
On a related note, I've just finished some R code to produce HTML 
imagemaps. You do something like this:

  im <- imagemap("Test",height=400,width=400)

  plot(1:10,1:10)

  addRegion(im) <- imCircle(5,5,.3,href="Point5.html")

  createPage(im,file="Test.html")

  imClose(im)

This produces Test.html and Test.png. When Test.html is viewed, you see 
the plot and can click within 0.3 units of the fifth point to go to the 
given URL.

  You can add rectangular, circular and polygonal clickable regions. You 
can specify a default for a click anywhere else. You can even have 
clickable rotated text or expressions. You can use par(mfrow=...) and 
have several plots with clickable bits on each one.

  Instead of createPage() you can call createIM() which will produce 
HTML Imagemap code for including into a web page.

  There's some horribly tricksy stuff involved in getting the right 
coordinates in the PNG file, and some limitations. Currently it cant 
deal with log-axes, and you cant do dev.copy() to put stuff in the PNG. 
But what it can do is quite useful.

  The documentation is sparsish, but once I've written some more 
examples and .Rd files I'll announce it to the world.

Baz
#
On Wed, 21 May 2003, Heywood, Giles wrote:

            
lag() is in package ts, which has a namespace these days.  Why are you
setting S4 methods on S3 generics?  You will be able to set S3 methods.
function (x, ...)
UseMethod("lag")
<environment: namespace:ts>
function (x, ...)
UseMethod("diff")
<environment: namespace:base>

(and BTW the base namespace is somewhat different and not locked).
The combination of S4 methods and namespaces is not supported, so if you 
need this you will need to define the S4 generic somewhere you own.