Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8672859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:18:27+00:00 2026-06-12T19:18:27+00:00

I am using RStudio and writing an .Rnw file to include LATEX and R

  • 0

I am using RStudio and writing an .Rnw file to include LATEX and R codes. There is a table to be inserted, and I use standard LATEX codes within the .Rnw file, like

\begin{table}[t]
\caption{SUMMARY}
\centering
\begin{tabular}{c|c|c|c|c|c}
\toprule
Data & stat1 & stat2 & stat3 & stat4 & stat5 \\
\midrule

itme1 & 36.101954 & 45 & 0.825500 & 0.220198 & 0.293448 \\
item2 & 51.828572 & 45 & 0.224900 & 0.499718 & 0.690064\\
item3 & 53.187455 & 45 & 0.188100 &  0.133086 & 0.603072 \\
item4 & 61.513952 & 45 & 0.051300 & 0.002566 & 0.014714 \\

\bottomrule
\end{tabular}
\label{tab:xxx}
\end{table}

However, when I click “Compile PDF” in RStudio, there is error message. I searched online about inserting tables in .Rnw file, and got the result of using xtable package. Can I use standard LATEX codes for doing this? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:18:28+00:00Added an answer on June 12, 2026 at 7:18 pm

    The answer to “whether we can insert raw latex codes for making tables in the .Rnw file” is YES. I finally find out that the error comes from the underscore: if your column name include a _, then you need to write \_. Otherwise, when you click compile PDF in RStudio, there will be error messages produced (and it is extremely hard to debug!)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I m using Rstudio under Win7. Is there a way that knitr automatically escape
So, I've been using the RStudio IDE lately, and I really like it. In
Using a populated Table Type as the source for a TSQL-Merge. I want to
Using ASIHTTPRequest, I downloaded a zip file containing a folder with several audio files.
I love RGoogleDocs and use it a lot. However, I don't like entering my
Using the Qt library, is there a way to automatically update a QDateTimeEdit using
Using range() in Underscore I can make something like this: _.range(10); >> [0, 1,
Using Jenkins or Hudson I would like to create a pipeline of builds with
Using Java,I have to fetch multiple sets of values from an XML file to
I have a long running job that I'd like to run using EC2 +

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.