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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:59:11+00:00 2026-05-24T15:59:11+00:00

Roxygen have made my work a lot easier and is in most cases nice

  • 0

Roxygen have made my work a lot easier and is in most cases nice and intuitive. One thing that I have never figured out though is how to preserve indentation in @examples sections so that the result of roxygenize("myPackage") containing

#' @examples
#' sapply(1:10, function(i){
#'     x <- rbind(matrix(rnorm(20), 10, 2),
#'                matrix(rnorm(20), 10, 2) + i)
#'     myFunc(x)
#' }

would be

\examples{sapply(1:10, function(i){
    x <- rbind(matrix(rnorm(20), 10, 2),
               matrix(rnorm(20), 10, 2) + i)
    myFunc(x)
}}

instead of

\examples{sapply(1:10, function(i){
x <- rbind(matrix(rnorm(20), 10, 2),
matrix(rnorm(20), 10, 2) + i)
myFunc(x)
}}

It is a small detail but it makes all but the simplest examples unnecessarily hard to read so I’d appreciate it if someone can help me.

Edit: This bug was corrected in later versions of roxygen.

  • 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-24T15:59:12+00:00Added an answer on May 24, 2026 at 3:59 pm

    Probably too much overhead for short examples, but for longer examples you could @example relative/path/to/example to pull in a file, which should get the indenting right.

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

Sidebar

Related Questions

I have a simple shell script that builds my Roxygen documents, builds the package,
I'm receiving an error from roxygenize() that I can't understand. I have a package
I'm having the opposite issues of this post . It seems that roxygen is
I haven't quite figured out a sensible workflow for building packages and writing their
Roxygen works fine from within R, but for some reason it craps out when
I have a package for R I've been developing under Linux, and the horrible
I used 'package.skeleton()' to generate .Rd help files a few months ago. I have
Other than the excellent SO answer here , and the Roxygen manual and vignette
I've recently been pointed towards Roxygen to solve my documentation woes/laziness. But then there's
This question is related to my question about Roxygen. I want to write a

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.