Re: [R] discrete variable

2008-03-02 Thread David Winsemius
"Pete Dorothy" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Hello, > > I am sorry for asking such a basic question. I could not find an > answer to it using google. > > I have a discrete variable (a vector x) taking for example the > following values : 0, 3, 4, 3, 15, 5, 6, 5 > >

Re: [R] discrete variable

2008-03-02 Thread Andrew Robinson
Pete, try x <- c(0, 3, 4, 3, 15, 5, 6, 5) table(x) or length(table(x)) Cheers Andrew On Sun, Mar 02, 2008 at 09:27:20PM +0100, Pete Dorothy wrote: > Hello, > > I am sorry for asking such a basic question. I could not find an answer to > it using google. > > I have a discrete variable (a

Re: [R] discrete variable

2008-03-02 Thread Ted Harding
On 02-Mar-08 20:27:20, Pete Dorothy wrote: > Hello, > > I am sorry for asking such a basic question. I could not find > an answer to it using google. > > I have a discrete variable (a vector x) taking for example the > following values : 0, 3, 4, 3, 15, 5, 6, 5 > > Is it possible to know how man

Re: [R] discrete variable

2008-03-02 Thread Henrique Dallazuanna
See > length(unique(x)) [1] 6 > table(x) On 02/03/2008, Pete Dorothy <[EMAIL PROTECTED]> wrote: > Hello, > > I am sorry for asking such a basic question. I could not find an answer to > it using google. > > I have a discrete variable (a vector x) taking for example the following > values : 0, 3,

[R] discrete variable

2008-03-02 Thread Pete Dorothy
Hello, I am sorry for asking such a basic question. I could not find an answer to it using google. I have a discrete variable (a vector x) taking for example the following values : 0, 3, 4, 3, 15, 5, 6, 5 Is it possible to know how many different values (modalities) it takes ? Here it takes 6 di