[R] re-vertical conversion of data entries
Uwe Ligges
ligges at statistik.tu-dortmund.de
Mon Oct 25 10:56:52 CEST 2010
It is just that the "vertical" (column) vector is represented that way
in R. If you want to dsiplay it in a column, just generate a matrix, for
simplicity:
matrix(x, ncol=1)
Uwe Ligges
On 25.10.2010 05:45, Penny Adversario wrote:
>
>
> Dear R user,
>
> Can you please
> help me. How do I convert part of a cluster analysis output under the heading âClustering
> vectorâ as shown below, showing the clusters to which each respondent belongs
> to:
>
> Â
>
> Â Â [1] 1 1 2 2 1 2 1 2 1 1 2 2 1 2 2 2 2 1 1 1
> 1 2 2 1 2 2 1 2 2 2 2 2 2 2 2 1 2
>
> Â [38] 2 1 1 2 2 2 2 2 1 2 1 2 2 2 2 1 2 1 2 2
> 1 2 2 2 2 2 2 1 2 1 2 2 2 1 1 2 2
>
> Â [75] 2 1 2 2 2 2 2 2 2 1 1 2 1 2 2 2 2 2 1 1
> 1 1 1 2 2 2 2 2 2 2 1 2 2 2 1 2 2
>
> .
>
> .
>
> .
>
> [8696] 2 1 1 2
> 1 1 1 1 2 2 1 1 1 1 1 1 1 1 2 1 1 2 1 1 1 1 2 2 2 2 2 2 2 1 2 2 2
>
> [8733] 2 2 1 1
> 2 1 2 2 1 2 2 1 1 2 1 2 2 1 2 2 2 2 1 2 2 2 1 2 1 2 2 2 1 2 1 1
>
> Â
>
> to a single vertical
> column? Thanks.
>
> Â
>
> I used the
> following code to arrive at the above output:
>
> pam(dm,2,diss=TRUE,
> medoids=NULL, cluster.only=FALSE,do.swap=TRUE, keep.data=FALSE, trace.lev=0)
>
> Â
>
> Penny
>
>
>
>
>
> [[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.
More information about the R-help
mailing list