[R] problem with merging two matrices

Sarah Goslee sarah.goslee at gmail.com
Thu Nov 3 19:21:07 CET 2011


On Thu, Nov 3, 2011 at 12:31 PM, flokke <flokke at live.de> wrote:
> Dear Sarah,
> THanks for your answer!
> Sorry that my thread is somehow not clear, that's because I am not really
> experienced with R and
> dont know yet how to put thinings in words..
> I am not trying to work with them differently, I am just trying to print
> them as the result of a
> function. But as the result() function does allow only one argument I have
> to somehow merge these
> two matrcices. I know that I could use the list() function as well but I
> wanted to have some nicer output than that, that's why I created these two
> matrices.
> Want I want to get in the end is that can call my function(x,y) and then you
> get the print
> of the two matrices, above each other.

See, that would have been useful to know.

If you wish to return two such matrices, you need to use a list.

If you are determined that they appear in a particular way, you could
also print them from within the function, so that particular things
appear onscreen regardless of the way in which the results are

But, in that case, you may be better off reconsidering what your
actual objectives are, and whether separating form and function might
not be a more effective course.


Sarah Goslee

More information about the R-help mailing list