Vi<-new2$Volume.y/new2$Volume.x
res<-new1[,5]*new2[,5]/sum(new1[,5]*new2[,5])
res
#[1] 0.004169822 0.008339644 0.070886971 0.291887526 0.002776516 0.599727397
#[7] 0.022212126
A.K.
- Original Message -
From: Raoni Rodrigues
To: r-help@r-project.org
Cc:
Sent: Tuesday, September 18, 201
Hello,
1) Instead of computing TFrequency and TVolume like you have, try the
following.
TF <- with(Frequency, ave(Frequency, Specie, FUN = sum))
TV <- with(Volume, ave(Volume, Specie, FUN = sum))
Fi <- with(Frequency, Frequency/TF)
Vi <- with(Volume, Volume/TV)
Importance <- Fi*Vi/sum(Fi*Vi)
Hello all,
I'm new in R, and I have a data-frame like this (dput information below):
Specie Fooditem Occurrence Volume
1 Schizodonvegetal 1 0.05
2 Schizodon sediment 1 0.60
3 Schizodonvegetal 1 0.15
4 Schizodon
3 matches
Mail list logo