z %% 2 == 1
has 12 logical values. What do you expect R to do with it worth respect to 4
rows?
--
Sent from my phone. Please excuse my brevity.
On May 30, 2016 11:38:46 AM PDT, Carl Sutton via R-help
wrote:
>Hi Guru's
>In my quest to understand R I have what I thought was a simple exercise
This is not an igraph issue, I believe. You need to go over your
indices and update the matrix, i.e.
for (i in seq_along(t.list)) { temp[t.list[i], c.list[i]] <-
temp[t.list[i], c.list[i]] + 1 }
Best,
Gabor
On Tue, Aug 2, 2011 at 4:50 PM, Robinson, David G wrote:
> I realize that matrix indexin
Thank you all once again .. Yeah, its working now.
--
Regards,
Mahalakshmi
Graduate Student
#20, Department of Geography
Michigan State University
East Lansing, MI 48824 Quoting Liviu Andronic :
> On Wed, Dec 22, 2010 at 6:39 PM, wrote:
>> Thank you both for your suggestions. I have anothe
Have you consulted R's extensive documentation? -- in particular, "An
Introduction to R," which would seem like an obvious place for R
newbies to start. If you had done so, you would have found your
question answered there in section 6.1 on lists.
-- Bert Gunter
On Wed, Dec 22, 2010 at 9:39 AM,
On Wed, Dec 22, 2010 at 6:39 PM, wrote:
> Thank you both for your suggestions. I have another question - is there a
> specific way to access the individual elements of a 'list' variable? i.e.
>
> dmi = matrix(rnorm(20),4,5)
> soi = matrix(rnorm(20),4,5)
> pe = matrix(rnorm(20),4,5)
> y <- list(dm
Thank you both for your suggestions. I have another question - is there a
specific way to access the individual elements of a 'list' variable? i.e.Â
dmi = matrix(rnorm(20),4,5)
soi = matrix(rnorm(20),4,5)
pe = matrix(rnorm(20),4,5)
y <- list(dmi, soi, pe)
y[[1]]Â Â gives
[,1]Â Â Â Â Â Â [,2
On Wed, Dec 22, 2010 at 2:57 AM, Phil Spector wrote:
> To make your loop work, you need to learn about the get function.
> I'm not going to give you the details because there are better
> approaches available.
> First, let's make some data that will give values which can be verified.
> (All the c
To make your loop work, you need to learn about the get function.
I'm not going to give you the details because there are better
approaches available.
First, let's make some data that will give values which can
be verified. (All the correlations of the data you created
are exactly equal to 1.)
Dear Murali,
Here is one way:
set.seed(123)
a <- matrix(abs(rnorm(100)), 10)
b <- rnorm(10)
apply(a,2,function(x) ifelse(b>quantile(b,probs=0.75),-x,x))
HTH,
Jorge
On Wed, Nov 5, 2008 at 11:30 AM, <[EMAIL PROTECTED]> wrote:
> Folks,
>
> I have a matrix:
>
> set.seed(123)
> a <- matrix(rn
you almost have it, e.g., check the following:
set.seed(123)
a <- matrix(rnorm(100), 10)
b <- rnorm(10)
ind <- b > quantile(b, 0.75)
a[ind, ] <- -a[ind, ]
a
I hope it helps.
Best,
Dimitris
[EMAIL PROTECTED] wrote:
Folks,
I have a matrix:
set.seed(123)
a <- matrix(rnorm(100), 10)
And a v
Rory Winston wrote:
> Hi
>
> Does anyone know how I might pick out diagonal elements of a matrix using a
> vector?
>
> If I create a matrix a:
>
> a <- matrix(c(1:16), 4, byrow=TRUE)
>
> and I want to pick out the elements (1,1),(2,2),(3,3), or another arbitrary
> diagonal (upper or lower), is ther
On Sat, 2008-04-12 at 10:56 +0100, Rory Winston wrote:
> Hi
>
> Does anyone know how I might pick out diagonal elements of a matrix using a
> vector?
>
> If I create a matrix a:
>
> a <- matrix(c(1:16), 4, byrow=TRUE)
Not sure if this does all that you describe below, but:
diag(a)
and you can
On 4/12/2008 5:56 AM, Rory Winston wrote:
> Hi
>
> Does anyone know how I might pick out diagonal elements of a matrix using a
> vector?
>
> If I create a matrix a:
>
> a <- matrix(c(1:16), 4, byrow=TRUE)
>
> and I want to pick out the elements (1,1),(2,2),(3,3), or another arbitrary
> diagonal
13 matches
Mail list logo