I am creating an automated survey analysis tool which has a parent dataframe name "Impact" which has a column "Level.Mapped.to". The idea is to split myData into different dataframes based on factor values of "Level.Mapped.to". I did this using :
LevelMap = split( ImpactDF , ImpactDF$Level.Mapped.to)
for(i in 1:length(LevelMap))
{
assign(paste0("LevelMapped", i), data.frame(LevelMap[i]))
}
Now this creates 3 different Dataframes LevelMapped1, LevelMapped2 and LevelMapped3.
Now for all these values I want to perform the following functions :
AvgImpactDF[i] = round(sapply(LevelMapped[i], function(x) mean(x,na.rm=TRUE,trim=0) ),2)
Now this AvgImpactDF is to be created for n number of levels in the ImpactDF. Please help me how I can do this.
My LevelMapped1 has 15 columns