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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:38:33+00:00 2026-05-31T00:38:33+00:00

I have a package for R I’ve been developing under Linux, and the horrible

  • 0

I have a package for R I’ve been developing under Linux, and the horrible time has come where I’m testing it under Windows.

The documentation is done using roxygen, and I am using cygwin to build the package.

The thing is, when I roxygenise('test-package'), roxygen truncates the \usage section of the documentation to one character. It does this to some but not all of my functions, and I can’t figure out the pattern.

This does not occur when run the same command (i.e. roxygenise('test-package') from the R prompt) under Linux or Windows – just Cygwin under Windows (using R devtools + command prompt from windows isn’t an option for me – it’s part of a big project with Makefiles etc).

In all cases, I am using roxygen v2.2.2.


Update:

This appears to occur for any function with a default parameter.


I’ve boiled it down to one reproducible example, trimmed down as much as possible to isolate the problem:

  1. From R:

    # this function used to trim strings, but I've stripped it right down
    # to eliminate it as a cause of the problem
    trim <- function(x='asdf')
    {
        return( x )
    }
    package.skeleton('test')
    
  2. modify trim.R (in test/R) and add the following roxygen to the top, so the file looks like:

    #' trim white spaces from a string
    #'
    #' @param x string or vector of strings to trim
    #' @return x trimmed.
    #' @export
    trim <-
    function(x='asdf')
    {
        return( x )
    }
    
  3. Run R and generate documentation:

    library(roxygen2)
    roxygenise('test')
    
  4. Look at the resulting trim.Rd file (in test/man):

    \name{trim}
    \alias{trim}
    \title{trim white spaces from a string}
    \usage{
      t
    }
    \arguments{
      ... # rest of .Rd file - nothing wrong here.
    

See how there’s just a \usage{t} ??

Of course, when one runs R CMD check one gets an error about documented arguments not appearing in the \usage, but that’s because \usage got truncated.

Does anyone know why this occurs and how I can work around it? Perhaps something in roxygen2 that relies on something that works in Mac, Windows & Linux but not Cygwin?

cheers (I’ve been tearing my hair out over this).

Update #2:

I have been using R installed from Cygwin’s package manager, as opposed to my Windows R (ie the one in C:/Program Files/R/R-2.14.2/bin) – I didn’t realise that Windows R would work under Cygwin.

If I use Windows R in Cygwin, the bug goes away. If I use Cygwin R in Cygwin, the bug is present.

I can only assume this is some bug related to Cygwin R, as opposed to roxygen2.

For now I will use the workaround of using Windows R within cygwin (in fact, now that I know I can do this, there’s no need for the Cygwin R anyway!).

  • 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-31T00:38:34+00:00Added an answer on May 31, 2026 at 12:38 am

    This is not a fix, but a workaround.

    I have been using R installed from Cygwin’s package manager, as opposed to my Windows R (ie the one in C:/Program Files/R/R-2.14.2/bin) – I didn’t realise that Windows R would work under Cygwin.

    If I use Windows R in Cygwin, the bug goes away. If I use Cygwin R in Cygwin, the bug is present.

    I can only assume this is some bug related to Cygwin R, as opposed to roxygen2.

    For now I will use the workaround of using Windows R within cygwin (in fact, now that I know I can do this, there’s no need for the Cygwin R anyway). This still gives me access to linux commands like make, sed and grep, but allows me to get the documentation working.

    The problem still remains that the Cygwin-R in Cygwin (not Windows-R in Cygwin) causes this bug, but perhaps it is not related to roxygen2 any more.

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

Sidebar

Related Questions

I have a package with a few modules, each module has a class (or
I have a package which has various features that depend on AUCTeX. As it
I have a package that has several components in it that would benefit greatly
I have two package, for example, packageA and packageB . in packageA I has
I have a package that I just made and I have an old-mode that
I have a package with logic classes(like CheckAuthenticationDataLogic.java, GetVocabulariesLogic.java). And another class - ApiService.java
Say I have a package mylibrary. I want to make mylibrary.config available for import,
My current requirement is: I have to package my grails app and use teamcity
Lucky me, I have to work with Oracle. And packages. I have a package
I'm using nose and coverage to generate coverage reports. I only have one package

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.