title: Automate distribution fitting in R
body: <p>I am trying to automate the process of fitting the most suitable distributions in R. 
  I have an excel column containing Time to failure of an automobile product. I input the file in R and read the column. Now I want to use goodness of fit tests to determine which distribution fits the data best. I want the output as the results of all test for different distributions displayed in a table format to help compare between the results. 
  Is it possible to automate the entire process with R and not do step by step for each distribution using functions like fitdistplus?
  Any suggestions?
  I used the log-likelihood function like this and it seems to be working fine. Which more tests can I use?
  Here is the code for loglik function-</p>
  
  <pre><code>library(gdata)
  Excel&lt;-read.xls("Failtime.xls", sheet="CPART10", perl="perl.exe")
  attach(Excel)
  x&lt;-Time_to_Fail
  library(MASS)
  
  distributions = c("normal","exponential","binomial""negative binomial","gamma","t","lognormal")
  x = x[ x &gt;= 0 ]
  for ( dist in distributions ) {
  print( paste( "fitting parameters for ", dist ) )
  params = fitdistr( x, dist )
  print( params )
  print( summary( params ) )
  print( params$loglik )
  y&lt;-params$loglik
  }
  </code></pre>