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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:07:29+00:00 2026-05-18T21:07:29+00:00

I have a simple shell script that builds my Roxygen documents, builds the package,

  • 0

I have a simple shell script that builds my Roxygen documents, builds the package, checks, then installs the newly built package on my machine. It’s quite simple:

#! /bin/sh
R CMD roxygen -d myPackage 
R CMD build myPackage/
R CMD check myPackage_0.01.tar.gz
R CMD INSTALL myPackage myPackage_0.01.tar.gz 

But I’m having issues with Roxygen picking up my .onLoad() function as described previously on StackOverflow. The solution is to use the use.Rd2=TRUE option with roxygenize. Well I want to build from the command prompt so I changed this line

R CMD roxygen -d myPackage 

to the following line which shoves a roxygenize line to R through the stdin:

echo 'require("roxygen"); roxygenize("myPackage", roxygen.dir="myPackage",
   copy.package=FALSE, use.Rd2=TRUE)' | R --no-save < /dev/stdin

This seems to work just dandy. But it feels a little convoluted. Is there an easier and/or more elegant way?

  • 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-18T21:07:30+00:00Added an answer on May 18, 2026 at 9:07 pm

    I do something similar, but I use a HERE document in the shell script to make it look cleaner.

    #!/bin/sh
    ##
    ##
    ## Must be run from the parent of the package directory (no options
    ## to change target of check or tarball!?!)
    
    PACKAGE="analyzeNMON"
    VERSION=$(awk -F": +" '/^Version/ { print $2 }' ${PACKAGE}/DESCRIPTION)
    
    R --no-restore --slave <<EOR
      library(roxygen)
      roxygenize(package.dir="${PACKAGE}",
                 roxygen.dir="${PACKAGE}",
                 use.Rd2=TRUE,
                 overwrite=TRUE,
                 copy.package=FALSE,
                 unlink.target=FALSE)
    EOR
    
    R CMD build ${PACKAGE}
    R CMD check ${PACKAGE}_${VERSION}.tar.gz
    R CMD INSTALL ${PACKAGE}_${VERSION}.tar.gz
    

    The R code is very similar to that in the script run during R CMD roxygen.

    The roxygen that is installed on my system (version 0.1; installed from CRAN this week) doesn’t seem to support the -s option mentioned above…

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

Sidebar

Related Questions

I have a simple Linux shell script that parses a file generated in windows
I have a simple shell script that starts chromium in kiosk mode on a
A really simple shell script question. I have a file with something like this:
I want a simple testing shell script that launches a program N times in
Is there a simple shell command/script that supports excluding certain files/folders from being archived?
I have the following simple shell script: # get all servers from config sshservers=`node
I need a very simple shell script that processes all images on a folder
I have a simple perl script that uses DBD::Oracle to run a query and
I have a bash shell script that loops through all child directories (but not
I have a simple shell script on my Ubuntu guest OS (running via VirtualBox):

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.