Re: [R] initialize a factor vector

From: Johannes Huesing <>
Date: Sun, 13 Jul 2008 21:44:40 +0200

Gavin Simpson <> [Sun, Jul 13, 2008 at 08:18:37PM CEST]:
> On Sun, 2008-07-13 at 18:47 +0200, Johannes Huesing wrote:
> > as.factor(c("eins", "zwei", "drei"))[FALSE]
> > does the job but looks a bit weird.
> >
> > factor(levels = c("one","two","three"))
> factor(0)
> Levels: one two three

Ah, ok, I was unaware of factor(), only knew as.factor().

Many thanks


Johannes Hüsing               There is something fascinating about science. 
                              One gets such wholesale returns of conjecture  from such a trifling investment of fact.                (Mark Twain, "Life on the Mississippi")

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sun 13 Jul 2008 - 19:48:55 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 13 Jul 2008 - 20:33:34 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive