title: Using fitdistr in the MASS library
body: <p>I am trying to use the fitdistr function, and have been reading the walkthough "Fitting Distributions with R". I can follow the outlined examples, with the 'dummy data', but my problem arises when I try to run my actual data with this function. 
  I believe the problem is due to the presence of headers in my data, since I am constantly getting the same error. For example, if I run my data (2 columns with headers), through for the 2nd column: </p>
  
  <pre><code>fitdistr(data$col2,"gamma")   
  'x' must be a non-empty numeric vector'
  </code></pre>
  
  <p>I have tried removing the header from my file and trying the function on all of my data (unbinned), which also resulted in the same error. </p>
  
  <p>Next, I tried removing the header, and only having the column of data that I want to run the function on in the data file. This does run properly. </p>
  
  <p>Please note that for my data, the 2nd column is what I am interested in running. But I have used the first column of data to sort the 2nd column into 20 different groups, so I do need the first column in the dataset. I can easily delete the headers and run the fitdistr() in a separate code (since I have been using headers to call columns thus far), but I cannot see how I could run this function with only one column of data, and still have that data binned properly. My first instinct is to bin the data in excel, then have 20 different, 1 column data sets to run through the function. This seems tedious, so any tips on how I can perform this function with my dataset intact is greatly appreciated. </p>
  
  <p>As requested here is a sample of my data:</p>
  
  <pre><code>&gt; dput(head(Diam_Str))
  structure(list(Diameter = c(0.03, 0.05, 0.05, 0.05, 0.05, 0.05
  ), Strength = c(0.2, 0.2, 1.5, 0.5, 0.6, 0.3)), .Names = c("Diameter", 
  "Strength"), row.names = c(NA, 6L), class = "data.frame")
  </code></pre>
  
  <p>So I have 20 groups, based on diameter size. For each group I am looking at the distributions of strengths seen. </p>