Skip to content
Advertisement

Find the average of multiple columns for each distinct variable in column 1

Hi I have a file with 6 columns and I wish to know the average of three of these (columns 2,3,4) and the sum of the last two (columns 5 and 6) for each unique variable in column one.

JavaScript

I have come across code that will get the average for column 2 based on column one but is there anyway I can expand this across columns? Thanks

JavaScript

I would like the output to be in the following format ;each variable in column one will also have a different number of rows

JavaScript

Advertisement

Answer

JavaScript

O/p:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement