Sorry,

I saw the word concatenate and dived in. Andrew Dolmans solution works fine.

Simon.


----- Original Message ----- From: "Linlin Yan" <yanlinli...@gmail.com>
To: "Simon Pickett" <simon.pick...@bto.org>
Cc: "Henning Wildhagen" <hwildha...@gmx.de>; <r-help@r-project.org>
Sent: Monday, May 18, 2009 12:30 PM
Subject: Re: [R] Concatenating two vectors into one


It seems that "c(x,y)" is not correct:
z<-c(x,y)
z
[1] "A" "B" "C" "D" "E" "F" "1" "2" "3" "4" "5" "6"

On Mon, May 18, 2009 at 7:17 PM, Simon Pickett <simon.pick...@bto.org> wrote:
z<-c(x,y)

cheers, Simon.


----- Original Message ----- From: "Henning Wildhagen" <hwildha...@gmx.de>
To: <r-help@r-project.org>
Sent: Monday, May 18, 2009 12:09 PM
Subject: [R] Concatenating two vectors into one


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-help@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.


______________________________________________
R-help@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.



______________________________________________
R-help@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.

Reply via email to