command line utility to print statistics of numbers in linux

后端 未结 16 1612
無奈伤痛
無奈伤痛 2020-11-30 18:46

I often find myself with a file that has one number per line. I end up importing it in excel to view things like median, standard deviation and so forth.

Is there a

16条回答
  •  隐瞒了意图╮
    2020-11-30 19:20

    There is also simple-r, which can do almost everything that R can, but with less keystrokes:

    https://code.google.com/p/simple-r/

    To calculate basic descriptive statistics, one would have to type one of:

    r summary file.txt
    r summary - < file.txt
    cat file.txt | r summary -
    

    For each of average, median, min, max and std deviation, the code would be:

    seq 1 100 | r mean - 
    seq 1 100 | r median -
    seq 1 100 | r min -
    seq 1 100 | r max -
    seq 1 100 | r sd -
    

    Doesn't get any simple-R!

提交回复
热议问题