Hi
Beter not to give a same name your values (variables) as is
function name. R is quite clever and
sample - rnorm(10)
sample - sample(sample,3)
works as expected, but it is not a rule.
Cheers
Petr
On 28 Oct 2004 at 17:54, Kunal Shetty wrote:
Dear R- users and Helpers
Is there some way
Dear R- users and Helpers
Is there some way to re initialise or clear the array elements? Pardon me for being
vague but the problem itself quite vague. I have attached the code along with email.
When I run the saved r- code using source(random1.txt) , command.
The program runs fine..but at
, as
you did to insert NAs randomly, or ifelse as you used to impute by means.
Reid Huntsinger
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kunal Shetty
Sent: Thursday, October 28, 2004 1:55 PM
To: [EMAIL PROTECTED]
Subject: [R] array problem
Dear all,
I define , for n=5 or any integer greater than 0.
A-array((1/2)^n , c(rep(2,n)))
then for any i not equal to j, and 1=i,j=n,
B-apply(a,c(i,j),sum)
now B is a 2 by 2 matrix, I also define another costant 2 by 2 matrix G,
How can I change the values of each elements of array A,
[,1,,2,] - A3[,1,,2,] * G[1,2]
A3[,2,,1,] - A3[,2,,1,] * G[2,1]
A3[,2,,2,] - A3[,2,,2,] * G[2,2]
identical(test(A,i,j),A3)
[1] TRUE
---
Date: Sun, 04 Jan 2004 21:42:55 +0800
From: Z P [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [R] array problem
Dear all,
I define , for n=5