Hello Team,

Platform:Windows 7 32-bit
R Version:3.2.2

I have two vectors as follows

> S = c("aa", "bb", "cc", "dd", "ee")
> X= c("aa", "bb", "cc", "dd")

When I trying a paste function

> z=paste(S,X)
> z

I am getting result as

[1] "aa aa" "bb bb" "cc cc" "dd dd" "ee aa"

I don't need the last element of S vector should get concatenated with
first element of X vector rather than it should take a space or null value
for concatenation. If I specify explicit space value in X vector like

> X= c("aa", "bb", "cc", "dd", " ")

Then I am getting result as
> z=paste(S,X)
> z
[1] "aa aa" "bb bb" "cc cc" "dd dd" "ee  "

Could you please suggest me how to turn off the Vector recycle in paste
function?

Thanks and Regards
Preetiranjan Pradhan

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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