Comparing frequency distributions Quick rundown of my data: I have depth measurements from fish with implanted transmitters from two sites (reference and hypoxic) and two seasons (spring and summer). All data is in an Excel spreadsheet. I separated the depths into 1-m bins (0, 1, 2,…6) and then counted the number of detections at each depth range. I have histograms of the depth distribution for each site during each season. How do I statistically compare histograms together to determine if the depth distributions differ with site and/or season (I need comparisons for Ref-Spring x Hyp-Spring, Ref-Summer x Hyp-Summer, Ref-Spring x Ref-Summer, Hyp-Spring x Hyp-Summer)? From my research I’m leaning toward the Kolmogorov-Smirnov test. My problem is that I’m uncertain how to input this data into R and run the actual test.
Partial Depth data table:

There are 56 fish total. The depth values are averages for each fish at that site and season. I used the Wilcoxon test because it was non-normally distributed. I created subsets of the main dataset which grouped depth by site and season and then compared depth between the subsets.
 A: The problem with the Kolmogorov-Smirnov is you have discretized data. If you use the usual null distribution, it needs continuous data. Binning it makes the test conservative, often to a surprising degree.
However, you can still do a Kolmogorov-Smirnov, by performing a permutation test on the actual discrete CDFs. 
There are a variety of ways to get your data into R. If it was me, I'd put just the data (depth bin, and the 4 sets of counts) into a sheet by itself, write as a .csv file and read that in, then use R to turn that back into 4 sets of individual binned depth measurements so that it's suitable for a permutation/randomization test (you can actually do it direct from the bin-counts, but it's conceptually much easier this way).
Whether the K-S is particularly suitable depends on what the alternatives of interest are.
It looks to me like you might need some form of GLM, but the interval censoring (caused by binning) will be a nuisance. (You could treat it as ordered categorical, perhaps.)
A: It may better to use quantitative data as it is and use paired t-test (or Wilcoxan test) rather than converting it into categorical data (a process in which some information will be lost). If you have unequal number of readings, you can use mean or median of readings in each transmitter in each season and then use paired t-test to compare between different different seasons. 
Edit: If data is not from same fish, unpaired t-test or Wilcoxan test can easily be used to compare 2 value sets of different sites and/or seasons (eg ref_summer vs hyp_summer).
If datadf is the dataframe having your data, then R code to compare depth at 2 sites during summer can be: 
with(datadf[datadf$Season=='Summer',], wilcox.test(Depth~Site))

#OR: to compare summer-normoxic vs spring-hypoxic:

wilcox.test(datadf[datadf$Season=='Summer' & datadf$Site=='Normoxic',]$Depth,  
            datadf[datadf$Season=='Spring' & datadf$Site=='Hypoxic',]$Depth   )

Unpaired=FALSE is the default.
