Re: [R] Assigning to multiple variables

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Sun, 13 Apr 2008 17:26:50 -0400

Normally in R one returns a list and assigns that to a single variable but if you really want to do it here is how:

http://tolstoy.newcastle.edu.au/R/help/04/06/1430.html

On Sun, Apr 13, 2008 at 4:56 PM, Scott Romans <scott.romans_at_mac.com> wrote:
> If we have a function that returns 2 or more values (such as dim as
> applied to a matrix), can we assign these 2 or more values to an equal
> number of differently named variables in one line? For example, is
> there any way to do something like this:
>
> [NumberRows NumberColumns] <- dim(MatrixA)
>
> Thanks in advance!
>
> Scott
>
> ______________________________________________
> R-help_at_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_at_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. Received on Sun 13 Apr 2008 - 21:28:59 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 13 Apr 2008 - 21:30:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive