An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/bioc-devel/attachments/20080213/4b833da3/attachment.pl
[Bioc-devel] class declaration
8 messages · John Lande, Sean Davis, James W. MacDonald +3 more
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
2008/2/13, John Lande <john.lande77 at gmail.com>:
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?
Define the classes, may be ? library(Biobase) is one simple way to do so. Hoping this helps, L.
--
john
[[alternative HTML version deleted]]
_______________________________________________ Bioc-devel at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel
An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/bioc-devel/attachments/20080213/280dc7c1/attachment.pl
Hi John,
> setClass("my class",representation(a="ExpressionSet", b="ExpressionSet"))
[1] "my class"
Warning message:
In .completeClassSlots(ClassDef, where) :
undefined slot classes in definition of "my class": a(class
"ExpressionSet"), b(class "ExpressionSet")
> library(Biobase)
Loading required package: tools
Welcome to Bioconductor
Vignettes contain introductory material. To view, type
'openVignette()'. To cite Bioconductor, see
'citation("Biobase")' and for packages 'citation(pkgname)'.
Warning message:
package 'Biobase' was built under R version 2.6.1
> setClass("my class", representation(a="ExpressionSet",
b="ExpressionSet"))
[1] "my class"
Best,
Jim
John Lande 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? -- john [[alternative HTML version deleted]]
_______________________________________________ Bioc-devel at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel
James W. MacDonald, M.S. Biostatistician Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623
You are not doing anything wrong (almost), but you need to have the
definitions of ExpressionSet before you can use those: library(Biobase)
However, I do not think it is a very good idea to declare a class with a
space in its name -- even if R allows that you never know where you are
going to use this definition and a space is a very particular character
in most programming languages -- it separates keywords, definitions,
concepts etc
* ~: R
:: R version 2.6.1 (2007-11-26)
> library(Biobase)
Loading required package: tools
> setClass("my class", representation(a="ExpressionSet",
b="ExpressionSet"))
[1] "my class"
>
Best,
Oleg
John Lande 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? -- john [[alternative HTML version deleted]]
_______________________________________________ Bioc-devel at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel
Dr Oleg Sklyar * EBI-EMBL, Cambridge CB10 1SD, UK * +44-1223-494466
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
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-----