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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:04:50+00:00 2026-06-04T01:04:50+00:00

I tried to create a package using some functions and scripts I created (using

  • 0

I tried to create a package using some functions and scripts I created (using X11 on a Mac). While R CMD check was doing its work, it encountered a problem as follows:

temp = trim(unlist(strsplit(lp.add(ranefterms[[i]]), 
+                     "\+")))
Error: '\+' is an unrecognized escape in character string starting "\+"

The oddest thing, however, is that my function actually does NOT have “\ +”. Instead, it has “\ \ +” (see below). So I don’t know why “\ \ +” is recognized as “\ +”.

for(i in 1:n)
   temp = trim(unlist(strsplit(lp.add(ranefterms[[i]]), '\\+')))

To dig a little further, I looked at the packageName-Ex.R file in the Rcheck folder. As it turned out, all the “\ \”s have been changed to “\” in the checking process (e.g., the double slashes I need for functions such as strsplit() and grepl())

I wonder what may have been the cause of it. Sorry that I can’t come up with a reproducible example…

  • 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-04T01:04:51+00:00Added an answer on June 4, 2026 at 1:04 am

    The offending code comes from the Examples section of one of your help files (which is why it ends up in packageName-Ex.R). To fix it, just escape each of the backslashes in the Examples sections of your *.Rd documentation files with a second backslash. (So, type \\to get \ in the processed help file, and type \\\\ to get \\.)

    Unless it’s escaped, \ is interpreted as a special character that identifies sectioning and mark-up macros (i.e. commands like \author, \description, \bold, and \ldots). Quoting from Duncan Murdoch’s Parsing Rd files (the official manual for this topic):

    The backslash \ is used as an escape character: \, \%, { and }
    remove the special meaning of the second character.

    As an example of what this looks like in practice, here is part of $R_SOURCE_HOME/src/library/base/man/grep.Rd, which is processed to create the help file you see when you type ?grep or ?gsub.

    ## capitalizing
    txt <- "a test of capitalizing"
    gsub("(\\\\w)(\\\\w*)", "\\\\U\\\\1\\\\L\\\\2", txt, perl=TRUE)
    gsub("\\\\b(\\\\w)",    "\\\\U\\\\1",       txt, perl=TRUE)
    

    In the processed help file, it looks like this:

     ## capitalizing
     txt <- "a test of capitalizing"
     gsub("(\\w)(\\w*)", "\\U\\1\\L\\2", txt, perl=TRUE)
     gsub("\\b(\\w)",    "\\U\\1",       txt, perl=TRUE)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to create a file using Oracle UTL_FILE.FOPEN command but i get this
I tried to create a new Swing GUI desktop application template using NetBean 7.0
I have tried to create a hello world Web Service using visual studio 2008,
when I tried to create a shared library file using the cl command in
We have tried to create sample webservices helloworld in Java using Jersey and Tomcat
I had some problems when I tried to create a loop in asm. So
Using the data-storage page in the docs , I've tried to store some data
We are using WiX to create two packages for our product. Package A includes
So, I'm doing some Kmeans classification using numpy arrays that are quite sparse-- lots
I'm trying to scrape some tables (election data) using the XML package. Browsing SO,

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.