[Bioc-devel] class declaration

Laurent Gautier lgautier at gmail.com
Wed Feb 13 20:11:43 CET 2008


It can certainly be strongly discouraged, just like variable names
should make sense is encouraged.
The R documentation does not seem to make a special case of it
help("'") will tell more about it.

Out of curiosity, I checked and there does not seem to be default
starting packages with spaces in variable names

unlist(lapply(loadedNamespaces(),
                    function(x) grep(" ", ls(getNamespace(x)))))
returns integer(0) here.

There is more to that than spaces, and the following might give
an idea of what is possible (don't try that at home ;-))

> assign("+", function(x, y) 42)
> 2+3
[1] 42


2008/2/14, Henrik Bengtsson <hb at stat.berkeley.edu>:
> Ok, now when that works I would like to ask a more general question:
>
> Is it completely safe to have spaces in class declarations?  ...or
> function definitions, e.g.
>
> > "foo bar" <- function(x) x
> > "foo bar"(3)
> [1] 3
>
> I can definitely see how this increases the risk for
> mistakes/misunderstandings.  Is this something that should be
> discouraged?
>
> /Henrik
>
> On Feb 13, 2008 6:56 AM, John Lande <john.lande77 at gmail.com> wrote:
> > yep worked! tnx
> >
> > On Feb 13, 2008 3:50 PM, Sean Davis <sdavis2 at mail.nih.gov> wrote:
> >
> > > On Feb 13, 2008 9:44 AM, John Lande <john.lande77 at gmail.com> wrote:
> > > > Dear all,
> > > >
> > > > I am creating a class for my function composed by two expression set:
> > > >
> > > > let say
> > > >
> > > > >setClass("my class",  representation(a="ExpressionSet",
> > > b="ExpressionSet")
> > > >
> > > > when I lunch it I retrieve this warning.
> > > >
> > > > [1] "my class"
> > > > Warning message:
> > > > In .completeClassSlots(ClassDef, where) :
> > > >   undefined slot classes in definition of "my class": a(class
> > > > "ExpressionSet"), b(class "ExpressionSet")
> > > >
> > > > how can  solve this problem?
> > >
> > > Hi, John.  You need to load Biobase first, as "ExpressionSet" is not
> > > defined.  That should solve the problem.
> > >
> > > Sean
> > >
> >
> >         [[alternative HTML version deleted]]
> >
> >
> > _______________________________________________
> > Bioc-devel at stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/bioc-devel
> >
>
> _______________________________________________
> Bioc-devel at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>


-- 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iEYEARECAAYFAkYgwJ4ACgkQB/w/MLoyRDeQlgCeMp8v69/Wy24Q4IaBVhoG1M5R
2h4AoIOTvKbrFpTklRDjV7u8tEOeSQqt
=JPph
-----END PGP SIGNATURE-----



More information about the Bioc-devel mailing list