The problem here is that RStudio knows where to look for Rd.sty, which is not part of CTAN and thus not part of TeX Live. (Rd.sty is something that is distributed with the base R packages and binaries but is not included in any TeX distribution that I know of.)
TeX Live, by default, is configured to only look in certain places for TeX things. The link provides more information about these predefined texmf trees. LyX is built atop a TeX distribution, and so it only knows to look in the places that your TeX distribution tells it to look for files.
It's possible to change the places that your TeX distribution will search, which is what is actually discussed in this question, a near duplicate.
However, I would suggest a different solution to this problem than the one that is discussed in that linked question and its answer.
TeX Live actually makes two texmf trees available out of the box that are intended for local files. These texmf trees are specified by the TeX Live variables TEXMFLOCAL and TEXMFHOME, which are discussed in more detail here. I would recommend using the TEXMFHOME tree in this case because the TEXMFLOCAL folder is overwritten when a new version of TeX Live is installed. (Note that there are actually advantages to using TEXMFLOCAL which are discussed if you follow the link. Given that Rd.sty has not yet made it onto CTAN and into TeX Live in all of its years of existence, it seems unlikely to me that it would make its way onto CTAN and into TeX Live ever. In this case, the advantages of installing to TEXMFLOCAL, which are discussed if you follow the link, are mooted; it makes much more sense to install Rd.sty into TEXMFHOME.)
To "install" Rd.sty into TEXMFHOME, it is sufficient to create a symbolic link (symlink) from wherever Rd.sty is on your computer to your TEXMFHOME folder.
If you haven't already created a TEXMFHOME folder (see also Where do I place my own .sty or .cls files, to make them available to all my .tex files?), you could do the following, which will set up a basic texmf tree that should cover most use cases and needs (there are, of course, more directories in a maximally TDS-compliant directory).
mkdir -p $(kpsewhich -var-value=TEXMFHOME)/{doc,generic,scripts,source} && \
mkdir -p $(kpsewhich -var-value=TEXMFHOME)/bibtex/{bib,bst} && \
mkdir -p $(kpsewhich -var-value=TEXMFHOME)/fonts/{afm,map,misc,pk,source,tfm,type1} && \
mkdir -p $(kpsewhich -var-value=TEXMFHOME)/tex/{context,generic,latex,plain,xelatex,xetex} && \
mkdir -p $(kpsewhich -var-value=TEXMFHOME)/tex/latex/biblatex/{bbx,cbx}
Now that you have a TEXMFHOME folder set up, you can symlink Rd.sty into the appropriate place.
If you are on Mac OS X, Rd.sty should be located at:
/Library/Frameworks/R.framework/Resources/share/texmf/tex/latex/Rd.sty
On my Ubuntu 14.04 machine, Rd.sty is located at:
/usr/share/texmf/tex/latex/R/tex/latex/Rd.sty
You might wish to check that the file is indeed there before trying to symlink it into TEXMFHOME, which you could do by running:
[ -f /usr/share/texmf/tex/latex/R/tex/latex/Rd.sty ] && ln -s /usr/share/texmf/tex/latex/R/tex/latex/Rd.sty $(kpsewhich -var-value=TEXMFHOME)/tex/latex/ || echo 'File does not exist'
Rd.styis located in/Library/Frameworks/R.framework/Resources/share/texmf/tex/latex/, so it's not in the LaTeX path. If you have TeX Live on a unix-like system, you could probably doln -s /Library/Frameworks/R.framework/Resources/share/texmf/tex/latex/Rd.sty $(kpsewhich -var-value TEXMFHOME)/tex/latex/(assuming you've set up a TEXMFHOME folder). – Adam Liter Jan 21 '16 at 13:52:pAnyway, roughly the same command should work on Ubuntu. Just symlinkRd.styinto TEXMFHOME and everything should work. – Adam Liter Jan 21 '16 at 16:24Rd.styis not on CTAN (and thus not part of TeX Live). – Adam Liter Jan 21 '16 at 16:26