Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Help with Mean/Median for data analysis

by pvaldes (Chaplain)
on Dec 22, 2011 at 12:27 UTC ( [id://944765]=note: print w/replies, xml ) Need Help??


in reply to Help with Mean/Median for data analysis

This its a trivial task with GNU-R. If you plan to go further and do more complex statistics in your data, I suggest you to take a look at the Statistics::R module in cpan and call directly R from perl. Something like:

use Statistics::R; my $R = Statistics::R->new(); $R->run(q`mydata <-read.table("mydatafile",... more options here)`); my $summary = $R->get(q`summary(mydata)`); print $summary;

Only as a quick example and untested, but you can see that you will need to write less code to do the same. You can use any other statistic modules that you prefer of course

Replies are listed 'Best First'.
Re^2: Help with Mean/Median for data analysis
by Marshall (Canon) on Dec 22, 2011 at 12:58 UTC
    I think that would be like using nuclear weapons to kill an ant!

    The real issue here appears to be: how to parse the input into a "record". Once that is done, its just a few lines to get the statistics required.

      Well, I only look over the post so I probably may be wrong, but probably the factor function of R could help here. I understand that the OP wants to apply as.factor to i.e the start column (or at the columns one to three concatenated).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://944765]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (11)
As of 2024-03-28 09:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found