Dear all,

Suppose my data frame is as follows:

id  price  distance
1   2     4
1   3    5
...
2  4   8
2  5   9
...
n  3   7
n   8  9

I would like to calculate the rank-order correlation between price and
distance for each id.

cor(price,distance,method = "spearman") calculate a correlation for all.

Then I tried to use
apply(data,list='id',cor(price , distance , method = "spearman"))
to

	[[alternative HTML version deleted]]

