[R] Fwd: simple question with table()

From: simone gabbriellini <simone.gabbriellini_at_sp.unipi.it>
Date: Sun, 30 Nov 2008 11:35:28 +0100

Dear ALL,

thank you for this sunday morning help! It works great!

all the best,
Simone

Il giorno 30/nov/08, alle ore 11:22, Jorge Ivan Velez ha scritto:

>
> Dear Simone,
>
> Try this:
>
> x=c(1,1,2,3,4,3,2,2,2,1,2,3,4,4,3)
> table(factor(x,levels=1:5))
> 1 2 3 4 5
> 3 5 4 3 0
>
> HTH,
>
> Jorge
>
>
>
> On Sun, Nov 30, 2008 at 5:05 AM, Simone Gabbriellini <simone.gabbriellini_at_gmail.com
> > wrote:
> Dear List,
>
> my problem should be easy to fix, but I couldn't find a solution by
> myself...
>
> In my survey, there is a question with 14 possible answers. None of
> the respondents choose the 13th answer, so when I table() the
> results, R says:
>
> 1 2 3 4 5 6 7 8
> 9 10 11 12 14
> 31 52 7 21 40 7 8 2
> 28 2 2 1 17
>
> 13 is missing... anyone knows how to tell table() that there are 14
> modalities in the answers? I tried with
>
> responseName
> =c("1","2","3","4","5","6","7","8","9","10","11","12","13","14")
>
> but all I have is:
>
> error in table....
> all the arguments must have the same length
>
> thank you,
> Simone
>
> ______________________________________________
> 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.
>

dott. Simone Gabbriellini - PhD Student
Department of Social Sciences
University of Pisa
simone.gabbriellini_at_sp.unipi.it

        [[alternative HTML version deleted]]



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. Received on Sun 30 Nov 2008 - 10:55:05 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 30 Nov 2008 - 11:30:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive