Skip to content
Back to formatted view

Raw Message

Message-ID: <7b83c147-8f1a-4bc2-afef-b2adef52b762@21g2000vbk.googlegroups.com>
Date: 2009-05-18T11:18:59Z
From: Tony
Subject: Concatenating two vectors into one
In-Reply-To: <20090518110945.133380@gmx.net>

Something like this should work:

z<- paste(x,y, sep='')

HTH,
Tony

On 18 May, 12:09, "Henning Wildhagen" <HWildha... at gmx.de> wrote:
> Dear users,
>
> a very simple question:
>
> Given two vectors x and y
>
> x<-as.character(c("A","B","C","D","E","F"))
> y<-as.factor(c("1","2","3","4","5","6"))
>
> i want to combine them into a single vector z as A1, B2, C3 and so on.
>
> z<-x*y is not working, i tried several others function, but did not get to
> the solution.
>
> Thanks for your help,
>
> Henning
>
> --
>
> ? ? ? ? [[alternative HTML version deleted]]
>
> ______________________________________________
> R-h... at r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.