Displaying 1 result from an estimated 1 matches for "groupvector".
Did you mean:
groupfactor
2010 Feb 10
1
mean calculation within dataframe corrupted
...res its value on this name.
However, it does not calculate the mean of these scores (LVMean) in the same
row correctly,
as you can see in the below output which strangely also contains NAs.
What is wrong??
Thanks for any hint!!!
######
## start
groupMeanForAllItems <- function(inputDataFrame, groupVector)
{
# build up result dataframe starting with group means
result <- data.frame(unique(groupVector));
# build up result column labels starting with group name
resultNames <- "groupname";
for (itemName in names(inputDataFrame))
{
# compute mean by group
tmpGroupMean <- calculateGrou...