Displaying 4 results from an estimated 4 matches for "matcor".
2003 Apr 25
3
Code bug unresolved involving if condition
...Matrix);nrow<-nrow(Matrix);
for (i in 1:nrow) {
for (j in 1:(ncol-1))
{if (Matrix[i,j]==NA) (NA->Matrix[i,j+1])}
}
}
I can charge it with the source() command
But I get the following message when applied to a matrix
> ClearDelta(MatCor)
Error in if (Matrix[i, j] == NA) (Matrix[i, j + 1] <- NA) :
missing value where logical needed
MatCor is the following Matrix
> MatCor
[,1] [,2] [,3]
[1,] NA 0.9870676 0.04648933
[2,] 0.98706757 1.0000000 -0.17353590
[3,] 0.04648933 -0.17...
2003 Apr 28
2
Writing a function
...function
> ClearDeltaBis
function(Matrix){
for (i in 1:3)
{
for (j in 1:2)
{if (is.na(Matrix[i,j]))
NA->(Matrix[i,j+1])}
}
Matrix
}
it looks correct but when I try to implement it on the MatCor Matrix I get
this error message
> ClearDeltaBis(MatCor)
Error: couldn't find function "(<-"
I don't understand where does it come from since I have no string like (<-
in my code
Thanks for any help that could be provided.
*****************************************...
2003 Apr 28
0
Re: [R Thanks for help Writing a function
...gt; for (i in 1:3)
> {
> for (j in 1:2)
> {if (is.na(Matrix[i,j]))
> NA->(Matrix[i,j+1])}
> }
> Matrix
> }
>
> it looks correct but when I try to implement it on the MatCor Matrix I get
> this error message
>
> > ClearDeltaBis(MatCor)
> Error: couldn't find function "(<-"
>
> I don't understand where does it come from since I have no string like (<-
> in my code
You do, in the line
NA->(Matrix[i,j+1])
That's an...
2005 Feb 07
5
Creating a correlation Matrix
Hi all:
I have a question on how to go about creating a correlation matrix. I have
a huge amount of data....21 variables for 3471 times. I want to see how
each of the variables correlate to each other. Any help would be
appreciated, including which package and which functions I should use to do
this.
Thanks,
Jessica Higgs
Masters Student
Department of Meteorology
Penn State University