XLConnect, rJava and package building -


i writing function want include in user-defined package (mypackage). function follows:

readschedule <- function(file){     wb = loadworkbook(file)     ws= readworksheet(wb, sheet = 'sheet1',header = true)     return(ws) } 

where file name of excel file want read. when writing function, want import xlconnect, since package uses. placed header code defining function:

@param file excel file @return excel data @export @import xlconnect 

i have added import(xlconnect) namespace , description file of mypackage. package builds fine (or @ least @ first cut appears build ok) when run "check package" fails , gives me following error:

* installing *source* package 'mypackage' ... ** r ** preparing package lazy loading ** *** installing indices ** building package indices ** testing if installed package can loaded *** arch - i386 error : .onload failed in loadnamespace() 'rjava', details:   call: fun(libname, pkgname)   error: no currentversion entry in software/javasoft registry! try re-installing java , make sure r , java have matching architectures. error: loading failed execution halted *** arch - x64 error: loading failed 'i386' 

i have correct version of java , can load rjava fine. i've tried importing rjava (similar xlconnect) same error. below sessioninfo:

r version 3.1.2 (2014-10-31) platform: x86_64-w64-mingw32/x64 (64-bit)  locale: [1] lc_collate=english_united states.1252  lc_ctype=english_united states.1252    lc_monetary=english_united states.1252 [4] lc_numeric=c                           lc_time=english_united states.1252      attached base packages: [1] stats     graphics  grdevices utils     datasets  methods   base       other attached packages: [1] mypackage  loaded via namespace (and not attached):  [1] chron_2.3-45     data.table_1.9.4 digest_0.6.8     lubridate_1.3.3  memoise_0.2.1    plyr_1.8.1        [7] rcpp_0.11.1      reshape2_1.4     rjava_0.9-6      stringr_0.6.2    tools_3.1.2      xlconnect_0.2-7  

it looks building package on windows 64-bit machine 64-bit version of java installed. when checking package using r cmd check, r default attempts check package on other sub-architectures (i386, 32-bit) in case in addition require 32-bit installation of java.

if want check package i386 may additionally install java 32-bit. other option pass option --no-multiarch r cmd check call, e.g. r cmd check --no-multiarch mypackage.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -