Displaying 3 results from an estimated 3 matches for "sp_a".
Did you mean:
sp_2
2010 Jun 26
7
Calculating Summaries for each level of a Categorical variable
...equire to this function?
Dataset: RT=
R A T W H
R1 10 20 20 10
R2 60 20 50 10
R3 45 10 20 50
R4 68 50 20 10
R1 73 20 40 46
R3 25 30 10 54
R3 36 90 20 10
R2 29 10 30 30
# FUNCTION TO CALCULATE THE WEIGHTED AVERAGE FOR A WEIGHTED BY C
WA<-function(A,C) {
sp_A<-c(A %*% C)
sum_C<-sum(C)
WA<-sp_A/sum_C
return(WA)
}
I am trying to incorporate the additional step of calculating the weighted
average of A,T,W and H for each level of R. Need help with this.
Thanks in advance!
Raoul
--
View this message in...
2010 Jun 13
0
Weighted Average application on Summary Dataset
...N (Sum of N)
A SR1 912.0098 102
SR3 896.5294118 85
B SR2 914.3636364 55
SR4 957.1966292 178
(Weighted Average
of A for N weights)
# FUNCTION TO CALCULATE THE WEIGHTED AVERAGE FOR A WEIGHTED BY N
WA<-function(A,N) {
sp_A<-c(A %*% N)
sum_N<-sum(N)
WA<-sp_A/sum_N
return(WA)
}
Thanks in advance!
Raoul
--
View this message in context: http://r.789695.n4.nabble.com/Weighted-Average-application-on-Summary-Dataset-tp2253239p2253239.html
Sent from the R help maili...
2005 Apr 13
1
barplot usage
Hi,
I?m trying to make a barplot with the following dataframe, with information on
relative frequency per sediment type (ST) for some species:
Species ST1 ST2 ST3
SP_A 10 60 30
...
At x-axis are (should be ...) the species names and at y-axis the frequency per
sediment, in stacked bars.
I tried to use barplot command but with no results. Could anyone help me on this?
Thanks in advance,
Samantha
-------------------------------------------------
We...