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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:08:31+00:00 2026-05-16T15:08:31+00:00

I am having trouble finding clear documentation on how to set up a batch

  • 0

I am having trouble finding clear documentation on how to set up a batch file for a Sweave document on Windows XP.

I am using the batch files that are found here

I have created a batch file names run.bat which contains the following:

Sweave myFile.Rnw

The first thing I do in my Sweave file after setting the wd is read in a dataset using the RODBC package:

library(RODBC)
fetch <- odbcConnect("myDatabase")
myData <- "select * from myTable"
x <- sqlQuery(fetch, myData)
odbcCloseAll()

When I run my batch file, I receive the following error:

Error: chunk 2
Error in library(RODBC) : there is no package called RODBC
In addition: Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
    there is no package called 'xtable'

Obviously these packages do exist and are functional, but something isn’t right in the permissions or it isn’t finding the right directories. Any thoughts?

Related question here

  • 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-16T15:08:31+00:00Added an answer on May 16, 2026 at 3:08 pm

    I found an immediate solution to my problem, though understand there are certain limitations to this method. I abandoned using the CRAN provided .bat files for dynamically finding the appropriate path to R and hardcoded the path to R as such:

    "C:\Program Files\R\R-2.11.0\bin\Rterm.exe" --vanilla <%run.r>%run.r
     del *.log
     del *.aux
    

    This .bat file will fire up R, run the script run.r which contains two commands:

    Sweave("myFile.Rnw")
    tools::texi2dvi("myFile.tex", pdf=TRUE)
    

    and then cleans up the intermediate .log and .aux files from the LaTeX output. Obviously, the bulk of the work is done in myFile.Rnw but this will atleast let me click one button, perform my analysis, and generate the PDF file.

    If someone can think of a way to make this more efficient, I’d appreciate it.

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

Sidebar

Related Questions

I'm having trouble finding documentation that makes me think that you can make requests
I'm having trouble finding a Yacc or Bison that doesn't require using darwinports for
I'm having trouble finding a way to do this in a way that doesn't
I'm having some trouble finding documentation on CLOSING a blackberry map. My map opens,
I'm having trouble finding a clear explanation of connection pooling. I'm building an app
I'm having trouble finding a clear answer to this question so I thought I'd
I am having trouble finding clear and reliable examples of connecting to a PostgreSQL
I am having trouble finding a clear, sensible example of usage of context with
I'm having trouble finding books on the Windows Volume Shadow Copy Service. Can anyone
I'm having trouble finding the documentation on how to add panels to a SplitContainer

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.