[R] Rscript fails where Rterm works

Bond, Stephen Stephen.Bond at cibc.com
Fri Jun 13 14:44:10 CEST 2014


Hadley,

You are a genius.

Stephen B
-----Original Message-----
From: Hadley Wickham [mailto:h.wickham at gmail.com] 
Sent: Thursday, June 12, 2014 5:18 PM
To: Bond, Stephen
Cc: r-help at r-project.org
Subject: Re: [R] Rscript fails where Rterm works

Explicitly load the methods package: library(methods)

Hadley

On Thu, Jun 12, 2014 at 2:22 PM, Bond, Stephen <Stephen.Bond at cibc.com> wrote:
> I have a script which loads
>
> library(XLConnect)
> wb <- loadWorkbook("wbname")
>
> the code works without errors when run from ESS which uses
> R version 3.0.1 (2013-05-16) -- "Good Sport"
> Copyright (C) 2013 The R Foundation for Statistical Computing
> Platform: i386-w64-mingw32/i386 (32-bit)
>
> But fails when run from Rscript
> which Rscript
> C:\Program Files\R\R-3.0.1\bin\i386\Rscript.EXE
>
> Rscript updatevols.R
>
> Warning message:
> package 'RODBC' was built under R version 3.0.2
> XLConnect 0.2-7 by Mirai Solutions GmbH
> http://www.mirai-solutions.com ,
> http://miraisolutions.wordpress.com
> Warning message:
> package 'XLConnect' was built under R version 3.0.3
> Error in .jfield(x, "Ljava/lang/Class;", "TYPE") :
>   could not find function "getClass"
> Calls: loadWorkbook ... ._java_class_list -> lapply -> FUN -> .jfield -> .Call
> Execution halted
> Warning message:
> closing unused RODBC handle 1
>
> Any clues?
>
> Stephen B
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



-- 
http://had.co.nz/


More information about the R-help mailing list