0

I worked out all of these recipes, step by step. Checked a lot of times that every condition is met:

  1. Using MySQL in R for Windows

  2. adding RMySQL package to R fails (on Windows)?

  3. http://biostat.mc.vanderbilt.edu/wiki/Main/RMySQL

  4. http://cran.r-project.org/web/packages/RMySQL/INSTALL

My setup:

  • Windows XP 32bit

  • MySQL 5.5 server/client with all necessary lib and include files

  • PATH: C:\Program Files\R\R-2.12.2\bin\i386 ; C:\WINDOWS\system32 ; C:\WINDOWS ; C:\Progra~1\R\R-212~1.2\bin ; C:\Rtools\bin ; C:\Rtools\MinGW\bin

Still I am not able to even start compilation with R. RStudio gives me:

> install.packages('RMySQL', type ='source')
Installing package(s) into ‘C:/Documents and Settings/.../My Documents/R/win-library/2.12’
(as ‘lib’ is unspecified)
trying URL 'http://ftp5.gwdg.de/pub/misc/cran/src/contrib/RMySQL_0.9-3.tar.gz'
Content type 'application/x-gzip' length 165363 bytes (161 Kb)
opened URL
downloaded 161 Kb

>Warning in install.packages :
  installation of package 'RMySQL' had non-zero exit status

>The downloaded packages are in
    ‘C:\Documents and Settings\...\Local Settings\Temp\RtmpZnaoz4\downloaded_packages’

R CMD is starting compilation, but then it suddenly fails. I had to add the path to the C:\Rtools\MinGW\bin in the default windows path for R CMD to access gcc, although it is not mentioned in any of above recipes. I suspect that there's something going on with paths. Maybe R is not accessing Rtools or gcc or Rcmd, MySQL or something...

>C:\Documents and Settings\...\downloaded_packages>R CMD INSTALL RMySQL_*.tar.gz

>* installing to library 'C:\Documents and Settings\...\My Documents/R/win-library/2.12'

>* installing *source* package 'RMySQL' ...

>checking for $MYSQL_HOME... C:/PROGRA~1/MySQL/MYSQLS~1.5

>cygwin warning:

>  MS-DOS style path detected: C:/PROGRA~1/MySQL/MYSQLS~1.5

>  Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/MySQL/MYSQLS~1.5

>  CYGWIN environment variable option "nodosfilewarning" turns off this warning.

>  Consult the user's guide for more details about POSIX paths:

>    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

>** libs

>Warning: this package has a non-empty 'configure.win' file,

>so building only the main architecture

>cygwin warning:

>  MS-DOS style path detected: C:/PROGRA~1/R/R-212~1.2/etc/i386/Makeconf

>  Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-212~1.2/etc/i386/Makeconf

>  CYGWIN environment variable option "nodosfilewarning" turns off this warning.

>  Consult the user's guide for more details about POSIX paths:

>    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

>gcc -I"C:/PROGRA~1/R/R-212~1.2/include" -I"C:/PROGRA~1/MySQL/MYSQLS~1.5"/include        >-O3 -Wall  -std=gnu99 -c RS-DBI.c -o RS-DBI.o

>gcc -I"C:/PROGRA~1/R/R-212~1.2/include" -I"C:/PROGRA~1/MySQL/MYSQLS~1.5"/include        >-O3 -Wall  -std=gnu99 -c RS-MySQL.c -o RS-MySQL.o

>gcc -shared -s -static-libgcc -o RMySQL.dll tmp.def RS-DBI.o RS-MySQL.o C:/PROGRA~1/MySQL/MYSQLS~1.5/lib/opt/libmysql.lib -LC:/PROGRA~1/R/R-212~1.2/bin/i386 -lR

>installing to C:\Documents and Settings\...\My Documents/R/win-library/2.12/RMySQL/libs/i386

>** R

>** inst

>** preparing package for lazy loading

>Creating a new generic function for "format" in "RMySQL"

>Creating a new generic function for "print" in "RMySQL"

>** help

>*** installing help indices

>** building package indices ...

>** testing if installed package can be loaded

>MYSQL_HOME defined as C:/PROGRA~1/MySQL/MYSQLS~1.5

>Error : .onLoad failed in loadNamespace() for 'RMySQL', details:

>  call: dir(path = mysql, pattern = "^include$", include.dirs = TRUE,

>  error: unused argument(s) (include.dirs = TRUE)

>ERROR: loading failed
>* removing 'C:\Documents and Settings\...\My Documents/R/win-library/2.12/RMySQL'
Community
  • 1
  • 1
dabac76
  • 1
  • 1
  • 1
  • 1
    Is there a valid reason to do this with an out-of-date version of R? I just checked and the version of your RMySQL is current and is probably different than existed with R 2.12 was around. – IRTFM Jan 25 '12 at 14:30

1 Answers1

1

Read the error message.

call: dir(blah blah

error: unused argument(s) (include.dirs = TRUE)

The include.dirs argument to dir was added in R-2.13.0. See the NEWS file.

Community
  • 1
  • 1
Richie Cotton
  • 118,240
  • 47
  • 247
  • 360
  • Thanx! Confirmed that it works after R upgrade. I used the following procedure for upgrade: http://www.r-statistics.com/2010/04/changing-your-r-upgrading-strategy-and-the-r-code-to-do-it-on-windows/ and the following procedure for RMySQL install: http://biostat.mc.vanderbilt.edu/wiki/Main/RMySQL – dabac76 Jan 26 '12 at 10:31
  • @garavi: If the answer solved your problem, click the up arrow next to the answer to upvote and the tick to mark it as the solution. – Richie Cotton Jan 26 '12 at 12:05