0.6489858
>
> Here you see values of vector with smaller length is getting repeated.
> Instead of repetition, I would like to fill those with "NA" (or possibly
> some predefined fixed value)
>
> Would you please suggest me how to do that?
>
> Thanks,
>
>
>
Fri, 3/9/10, Henrique Dallazuanna wrote:
From: Henrique Dallazuanna
Subject: Re: [R] Matrix to list
To: "Ron Michael"
Cc: r-h...@stat.math.ethz.ch
Date: Friday, 3 September, 2010, 8:07 PM
Try this:
unclass(as.data.frame(mat))
On Fri, Sep 3, 2010 at 9:48 AM, Ron Michael wrote:
Dear
Try this:
unclass(as.data.frame(mat))
On Fri, Sep 3, 2010 at 9:48 AM, Ron Michael wrote:
> Dear all, suppose I have following matrix:
>
> > mat <- matrix(rnorm(25), 5)
> >
> > mat
> [,1] [,2][,3] [,4] [,5]
> [1,] 0.97056228 -1.3278509 -0.73511792 2.16506
On Sep 3, 2010, at 7:48 AM, Ron Michael wrote:
> Dear all, suppose I have following matrix:
>
>> mat <- matrix(rnorm(25), 5)
>>
>> mat
> [,1] [,2][,3] [,4] [,5]
> [1,] 0.97056228 -1.3278509 -0.73511792 2.1650629 -0.4411997
> [2,] 0.58613700 -0.2559899 -1
Dear all, suppose I have following matrix:
> mat <- matrix(rnorm(25), 5)
>
> mat
[,1] [,2] [,3] [,4] [,5]
[1,] 0.97056228 -1.3278509 -0.73511792 2.1650629 -0.4411997
[2,] 0.58613700 -0.2559899 -1.18334248 -1.4990907 1.8138846
[3,] -1.0313 2.0227887
Try this:
mat_list <- lapply(split(mat, seq(nrow(mat))), matrix, ncol = 3)
On Mon, Dec 28, 2009 at 9:20 AM, Ron_M wrote:
>
> let consider following matrix :
>
> mat <- matrix(rnorm(45), 15)
>
> Now I want to convert it to a list object "mat_list", which will have 15
> elements and each element
let consider following matrix :
mat <- matrix(rnorm(45), 15)
Now I want to convert it to a list object "mat_list", which will have 15
elements and each element will again be a matrix with 3 rows and 3 columns.
How can I do that?
Thanks,
--
View this message in context:
http://n4.nabble.com/
Try this:
m <- matrix(rep(1:3, 3), 3, dimnames = list(letters[1:3], letters[1:3]))
as.data.frame.table(t(m))
On Wed, Sep 17, 2008 at 10:52 PM, Pinder, Adrian
<[EMAIL PROTECTED]> wrote:
> Hi, can someone please tell me how to convert a square matrix to a list in R?
>
> i.e. I want to convert from:
Thanks to all who replied to this question. Jorge's script worked a treat.
Hi, can someone please tell me how to convert a square matrix to a list in R?
i.e. I want to convert from:
a b c
a 1 1 1
b 2 2 2
c 3 3 3
to:
a
On Wed, Sep 17, 2008 at 8:52 PM, Pinder, Adrian
<[EMAIL PROTECTED]> wrote:
> Hi, can someone please tell me how to convert a square matrix to a list in R?
>
> i.e. I want to convert from:
>
>a b c
> a 1 1 1
> b 2 2 2
> c 3 3
Hi, can someone please tell me how to convert a square matrix to a list in R?
i.e. I want to convert from:
a b c
a 1 1 1
b 2 2 2
c 3 3 3
to:
a a 1
a b 1
a c 1
b a 2
b
11 matches
Mail list logo