[R] problems while correlating values
Ahamarshan jn
ashgene at yahoo.co.in
Sun May 28 21:14:37 CEST 2006
Hi,
I am a newbie to the world of R.
I have a data converted in csv format. Few cells in
some of the rows of the data are blank ( in the sense
that there is no value available for the particular
experiment). When i try to open the file in R. I get
an warning message.
The specific warning message i get is
{Warning message:
NAs introduced by coercion }
My data more or less looks like this
- exp1 exp2 exp3 exp4 exp5 exp6
fish 20 10 40 30 - 10
duck 15 - 20 - - -
swan 10 5 7 12 15 -
kiwi 12 10 30 15 16 12
goat 18 10 20 - 10 -
{where '-' is blank spaces}
when I correlate this data using this
> round(cor(person.data,use="pairwise.complete.obs"))
correlation is done between experiments i.e. exp1,
exp2, exp3 etc whereas I need correlation to be done
row wise ie between fish,duck,swan,etc..
Another issue that I want to know of is, is there any
way to calculate the number of column pair's fills (N)
used in the correlation between data. ie for eg taking
these two values fish and duck
- exp1 exp2 exp3 exp4 exp5 exp6
fish 20 10 40 30 - 10
duck 15 - 20 - - -
it is in exp1 and exp3 that the values are available
and thus correlation is done only for these two exp's
hence we say N=2
like this between fish and swan N =4
- exp1 exp2 exp3 exp4 exp5 exp6
fish 20 10 40 30 - 10
swan 10 5 7 12 15 -
is there any way in R which would give me this value
of N between these Data used for correlation?
Also why is that an 'x' is introduced as a prefix to
the variable names when i compute with R is there any
way this can be removed?
Thank you
-ash#
More information about the R-help
mailing list