Literate programming with knitr and LyX requires LyX to call Rscript. I've discovered, as the subject line says, that the R package gdata can't be loaded by R scripts called from LyX. The gory details are here: http://stackoverflow.com/questions/17130424/on-my-system-knitr-cant-compile-a-doc-that-uses-the-gdata-package
I will also take this opportunity to thank the devs creating, improving, and maintaining LyX. Corey