1

I have R 2.14 installed on a Mac OS X 10.7.2 (Lion).

I noticed that when I try to use the sqldf package, R hangs. I tried the fix as suggested by the sqldf help, which is to execute:

options(gsubfn.engine = "R")    

prior to loading the sqldf package. This does not work. I installed the tcltk-8.5.5-x11.dmg package but still no change.

I tried to install the XQuartz software (xquartz.macosforge.org/). Despite this, R still hangs when sqldf is used or when loading the tcltk package.

Does anyone have suggestions for this problem?

1 Answers1

2

You haven't given us the results of sessionInfo() or your code or any error messages, ... but you should. If you haven't yet done so, then require sqldf (which should load the dependency gsubfn) packages:

require(sqldf) # just installing is not enough
a1s <- sqldf("select * from warpbreaks limit 6")
Loading required package: tcltk
Loading Tcl/Tk interface ... done
> a1s
  breaks wool tension
1     26    A       L
2     30    A       L
3     54    A       L
4     25    A       L
5     70    A       L
6     52    A       L

It does take some time to accomplish that tcltk-loading but it did happen in about half a minute.

Ah, I suspect I see the problem: your version 2.14.0 (2011-10-31). You probably need to get a more recent version of R. Mine is 2.14.0 Patched (2011-11-13 r57650). There was a NAMESPACE issue with that version of R for Macs and it was fixed in a few days by Simon Urbanek, and the fix reported on both the R-help and MAC_SIG mailing lists.

IRTFM
  • 258,963
  • 21
  • 364
  • 487
  • sqldf("select * from iris") or library(tcltk) hangs the R console – user1086586 Dec 07 '11 at 23:03
  • The output from sessionInfo() is R version 2.14.0 (2011-10-31) Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) locale: [1] C/en_US.UTF-8/C/C/C/C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] sqldf_0.4-5 chron_2.3-42 gsubfn_0.5-7 proto_0.3-9.2 RSQLite.extfuns_0.0.1 [6] RSQLite_0.11.0 DBI_0.2-5 loaded via a namespace (and not attached): [1] tools_2.14.0 – user1086586 Dec 07 '11 at 23:28
  • Does this mean I need to download the source and compile on the Mac OS? How? – user1086586 Dec 08 '11 at 00:07
  • If you mean how to update R, then why not use the binaries at CRAN or the att.research.com website? – IRTFM Dec 08 '11 at 00:14
  • I installed the latest patched version. Same problem. R version 2.14.0 Patched (2011-12-06 r57839) – user1086586 Dec 08 '11 at 00:26
  • You will get a more knowledgeable set of eyes and brains by posting all of this on the MacSIG mailing list. I'm guessing they will tell you to make sure your Tcl/Tk installation may need to be reinstalled, but this seems above my pay grade at this point. – IRTFM Dec 08 '11 at 00:32