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 5970129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:19:48+00:00 2026-05-22T20:19:48+00:00

How can I produce a Sweave (or pgfSweave) document without angle brackets > in

  • 0

How can I produce a Sweave (or pgfSweave) document without angle brackets “>” in front of code chunks? I want people to be able to cut and paste my code directly from the pdf output. Here’s a snippet of my document with a code chunk:

Notice that because our incidence matrix consists of 0’s and 1’s, the off-diagonal entries represent the total number of common columns, which is exactly what we wanted. We’ll use the %*% operator to tell R to do this. Let’s first take a look at a small example using toy data of people and groups to which they belong. We’ll coerce the data to an incidence matrix using the table() function, then multiply the incidence matrix by its transpose to get the number of common groups between people.

>\> ToyDat <- data.frame(person = c("Sam", "Sam", "Sam", "Greg", "Tom", "Tom"), group = c("a", "b", "c", "a", "b", "c"), stringsAsFactors = F)
>\> ToyDatM <- as.matrix(table(ToyDat)) 
>\> ToyDatM

But I want the code to look like:

> ToyDat <- data.frame(person = c("Sam", "Sam", "Sam", "Greg", "Tom", "Tom"), group = c("a", "b", "c", "a", "b", "c"), stringsAsFactors = F)    
> ToyDatM <- as.matrix(table(ToyDat)) 
> ToyDatM
  • 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-05-22T20:19:49+00:00Added an answer on May 22, 2026 at 8:19 pm

    I think options(prompt = " ") at the top of your script will do it.

    prompt (in options()) controls the text string used for the prompt in an interactive session and I’m assuming it will do the same for a document processed through Sweave.

    EDIT: Thanks to Ben Bolker for pointing out that options(prompt = " ", continue = " ") will also take care of the “+” problem as well.

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

Sidebar

Related Questions

The PDF I can produce at the moment: (source: yart.com.au ) I want the
I'm decorating my C# code with comments so I can produce HTML help files.
I am making a program in c that can produce another c code. How
Are there any tools that'd indicate that your code can produce different results in
Is there a tool available that can produce an HTML summary list of perl
I'm writing a small .NET application that can produce SWF files, and I need
In native development, you can produce libraries - .so, .dll etc - that other
How can we produce the effect of the red line under a bad spelling
How can I produce a messagebox in a C# Win Forms application that displays
I have a list with 15 numbers. How can I produce all 32,768 combinations

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.