[R] (no subject)
Anne
anne.piotet at urbanet.ch
Wed Jan 12 17:16:40 CET 2005
I think you will find all the doc in the help files
> ?factor()
gets
The function 'factor' is used to encode a vector as a factor (the
terms 'category' and 'enumerated type' are also used for factors).
If 'ordered' is 'TRUE', the factor levels are assumed to be
ordered. For compatibility with S there is also a function
'ordered'.
'is.factor', 'is.ordered', 'as.factor' and 'as.ordered' are the
membership and coercion functions for these classes.
Usage:
factor(x, levels = sort(unique.default(x), na.last = TRUE),
labels = levels, exclude = NA, ordered = is.ordered(x))
ordered(x, ...)
etc...
c'est une variable de type catégorique! whose levels (values) are strings
To get help:
type ?functionname
or if you are under Windows see the menu "Help\Html help" and look under
Packages. What you will want first are the "Base" and "Statistics" packages
Anne
----- Original Message -----
From: <nicolas.deig at epfl.ch>
To: <r-help at stat.math.ethz.ch>
Sent: Wednesday, January 12, 2005 3:17 PM
Subject: [R] (no subject)
>
> hi,
>
> I am trying to grow a classification tree on some data, but I have a
little
> problem. In order to do so I have to use a function like "tree" in R and
on the
> internet help(tree) I get the following:
>
> "The left-hand-side (response) should be either a numerical vector when a
> regression tree will be fitted or a factor, when a classification tree is
produced"
>
> I would like to know what is a "factor" in R, is it numerical value with
no
> formula or just a word??
>
> Thanks in advance
> Nicolas
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
>
More information about the R-help
mailing list