I want to calculate the average of a list of named numbers. There are numeric(0) values that I want to delete first. In addition, I would like to know which list items contain numeric(0) values.
Here is an example of what the values might look like:
>r["gg",] $`01_1_er` gg 0.5176445 $`02_1_er` gg 0.4990959 $`03_1_er` gg 0.5691489 $`22_1_er` numeric(0) $`23_1_er` numeric(0) $`25_1_er` gg 0.386304
And here is the result of str:
> str(r["gg",]) List of 6 $ 01_1_er: Named num 0.518 ..- attr(*, "names")= chr "gg" $ 02_1_er: Named num 0.499 ..- attr(*, "names")= chr "gg" $ 03_1_er: Named num 0.569 ..- attr(*, "names")= chr "gg" $ 22_1_er: num(0) $ 23_1_er: num(0) $ 25_1_er: Named num 0.386 ..- attr(*, "names")= chr "gg"
Can anyone help?
source share