On 06/11/2007, Adrian Dusa <[EMAIL PROTECTED]> wrote:
>
> On Monday 05 November 2007, you wrote:
> > On 04/11/2007, Andrew Perrin <[EMAIL PROTECTED]> wrote:
> > > http://www.omegahat.org/RSPerl/
> > >
> > > ----------------------------------------------------------------------
> > > Andrew J Perrin - andrew_perrin (at) unc.edu -
> > > http://perrin.socsci.unc.edu
> > > Associate Professor of Sociology; Book Review Editor, _Social Forces_
> > > University of North Carolina - CB#3210, Chapel Hill, NC 27599-3210 USA
>
> >
> > hi, can some one convert this R command into perl for me?
> >
> > layout(matrix(1,2,3,4,5,6), 2,3, byrow=TRUE)
>
>
> I don't think anyone can possibly translate it into Perl (or in any other
> language), simply because your command is faulty.
> What are you trying to achieve:
> - produce a matrix, or
> - create a graphics device split into rows and columns?
>
> Either way, your matrix command is wrong, eg:
> matrix(c(1,2,3,4,5,6), 2, 3, byrow=TRUE)
>       ^^^
> (notice the c() function)


thanks, that was a typo.
What I want to to convert
layout(matrix(c(1,2,3,4), 2,2,, byrow=TRUE) ) to a perl code.

I tried it as
&R::call ("layout", "(matrix(c(1,2,3), 1,3, byrow=TRUE))" );

It is not working.

BUT the following is working

&R::eval ("layout (matrix(c(1,2,3), 1,3, byrow=TRUE))" );

The R Call involves 3 layers of R function c(), matrix() and layout(). The
essential question is how to implement the R functions in a logical order
into perl?

Hope some one can exmplify this.





Adrian
>
> --
> Adrian Dusa
> Romanian Social Data Archive
> 1, Schitu Magureanu Bd
> 050025 Bucharest sector 5
> Romania
> Tel./Fax: +40 21 3126618 \
>           +40 21 3120210 / int.101
>

        [[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.

Reply via email to