[R] What does class "call" mean? How do I make class "formula" into a "call"?

Bert Gunter gunter.berton at gene.com
Sat Jun 25 00:18:36 CEST 2011


Well, this is kind of complicated. The first place you should go for
help is not this list, but the R docs. Specfically ?call.  This
assumes familiarity with R's (S3) class system and language structure,
however.. For this, I suggest ?UseMethod and consulting the R Language
Definition Manual.

Perhaps some brave soul on this list will attempt a short explanation
in reply. But I am not (s)he.

Cheers,
Bert

Oh -- as for specific suggestions, I think you need to do what the
posting guide asks and provide a minimal reproducible example to give
people a clearer idea of what's going on.

On Fri, Jun 24, 2011 at 2:58 PM, Rita Carreira <ritacarreira at hotmail.com> wrote:
>
> I have a list called "tabs" that I would like to have the same structure as my list "eqSystem." The two look like they have the same format but they are different because when I look at their attributes, class(eqSystem[[1]]) is "call" but class(tabs[[1]]) is "formula". I want to have class(tabs[[1]]) as a call too. So what does "call" mean? And how do I make an object of type "formula" be of type "call"?
> Thank you so much!!!--Rita
>> class(tabs)
> [1] "list"
>> class(tabs[1])
> [1] "list"
>> class(tabs[[1]])
> [1] "formula"> class(eqSystem)
> [1] "list"
>> class(eqSystem[1])
> [1] "list"
>> class(eqSystem[[1]])
> [1] "call"
>
>
> Rita
> =====================================
> "If you think education is expensive, try ignorance."--Derek Bok
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
"Men by nature long to get on to the ultimate truths, and will often
be impatient with elementary studies or fight shy of them. If it were
possible to reach the ultimate truths without the elementary studies
usually prefixed to them, these would not be preparatory studies but
superfluous diversions."

-- Maimonides (1135-1204)

Bert Gunter
Genentech Nonclinical Biostatistics



More information about the R-help mailing list