I have this LaTex table from this link below:
I put it into either a R or Rmarkdown file.
It doesn't produce the result but gives squiggly red error lines that
I have to fix. How can I run the bottom LaTex code in R or Rmarkdown ?
Please advise !
I don't want to assume anything, but I like to verify some things that may be overlooked when troubleshooting. No offense meant by these questions:
First, do you have the R Markdown package installed in your R environment? I assume since you are posting on the RStudio community forum, you do. In RStudio, go to your packages list, and check to make sure R Markdown is there.
Second, are you entering your code in an R Markdown document? An R Markdown document is created with an RMD extension. A normal R code file is created with an R extension. Under File, you chose New file, and then R Markdown document? Try that now to start a new file.
Third, paste Yarnabrina's code in to your new R Markdown document. Strictly speaking the hyphens before the \usepackage lines are not necessary. Now click the dropdown next to KNIT at the top of the window and choose Knit to PDF. Did it create the file with the table that you expected? On my system it did.
Some LaTeX packages work in all the various output formats for R Markdown and some don't. One of the packages that your example is using generates errors when using it in R Markdown to generate Word or HTML output but works fine when creating PDF.
Thank you for the advise.
I put the path for MikTex and it work.
It created the pdf document just as Yarnabrina had produced in his post.
However I can't produce html doc though.