Simple list merging question

Simple list merging question



Another newbie question. I'm trying to figure out how to produce rr given dd and hh:


rr


dd


hh


dd = a, b, c, d, e, f, g, h;
hh = x, y;
rr = x, x, y, y, a, b, c, d, e, f, g, h;

Grid[dd, Frame -> All], Grid[hh, Frame -> All], Grid[rr, Frame -> All]




1 Answer
1


Join[#, # & /@ hh, dd]



x, x, y, y, a, b, c, d, e, f, g, h



Also:


Join[Transpose[hh, hh], dd]



x, x, y, y, a, b, c, d, e, f, g, h



Thanks for contributing an answer to Mathematica Stack Exchange!



But avoid



Use MathJax to format equations. MathJax reference.



To learn more, see our tips on writing great answers.



Some of your past answers have not been well-received, and you're in danger of being blocked from answering.



Please pay close attention to the following guidance:



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

PHP code is not being executed, instead code shows on the page

Administrative divisions of China

Cardinality of the set of algorithms