Hi, I have a following problem. I would like to loop through all data frames I have in my environment. Then I would like to compute Gini index for each. I tried this:
library(DescTools)
dfs <- ls()[sapply(mget(ls(), .GlobalEnv), is.data.frame)]
for (j in 1:length(dfs)){
Gini(dfs[j]$value)
}
But I got an error: Error: $ operator is invalid for atomic vectors. How can I fix it please? Thanks a lot!