Recycled preliminary clustering script to use as the starting point of the phenotype modeling script, the output of which will be model-fitted means and predicted responses w/o random effects.
Tiddyed up a bit the BIL IDs reclassification/ renaming script.  This will have to be modified once the final BIN genotypes arrive.
Minor changes to the clustering and SparseNet scripts.
Almost done with the function for fitting LMMs, outputting model-fitted means, and plotting the trait distribution across QTL populations lines.  I've been testing different plotting color palettes...
Done deciding / testing color palettes.
Done coding model-fitted mean function (for doing LMM fitting, coefficient table output w/ p-value, and plotting) for the leaf complexity data).
Cleaned up the function a bit.
Fixed a small bug at the end of the function w/ ggsave().  Reorganized the code a bit.
combined results table & plot into a list as the object that the function returns
added a 3rd input to the function to handle the y-axis labels.
debugged the function with respect to foreach()  ...it turns out that one cannot use return() at the end of a function when iterating with foreach(), but rather has to more "crudely" return the object in question by simply calling it at the end of the function.
deleted old non-iterating code
added a plant-related random effect term to the function's input so I wouldn't have to duplicate a ton of code unnecessarily for the 2 random effect variants that are needed.
Had to change to a different p-value calculation b/c the Kenward-Roger was taking way too long with the leaflet pseudo-replicated data.  I went with the normal approximation, i.e. I assumed infinite denominator df (i.e. Z/chi-squared test rather than t/F test)  ...because as # of groups increase t dist. tends to the Z dist.  The rule of thumb is that this is okay for > ~45 groups, and we have > 500 groups in the BIL data.

BTW, the proper code for p-values with KR df approx. is:
pvals <- 2 * pt(abs(data.frame(coef(summary(fit)))$t.value), df=KRdegfree, lower.tail=FALSE)
minor changes plus finished cleaning up code after p-value calculation change.
labeled code sections
Done with all fitted-mean estimates and trait plots.
fixed the foreach loops; I did need to allow it to join pieces.  Also, I added more text to the PCs' y-axis labels
Finished coding the predicted response function and scripting its use for the 4 sets of data.
fixed a typo