[R] How do I get the CEM (coarsened exact matching) package to run?

Daniel Malter daniel at umd.edu
Mon Feb 6 22:59:33 CET 2012


Hi, 

I am running a MacBook Pro with OS X 10.6.8. When I try to load library(cem) and run any function, R crashes. Any suggestions as to why this is? Thanks in advance. I think the problem is that I don't have all the "infrastructure" I need to run CEM, but I have no clue what to do either...




#Do I have tcltk (I have no clue what that is)

capabilities("tcltk")
tcltk 
 TRUE 



#Installing cem

trying URL 'http://r.iq.harvard.edu/src/contrib/cem_1.0.218.tar.gz'
Content type 'application/x-gzip' length 886578 bytes (865 Kb)
opened URL
==================================================
downloaded 865 Kb

* installing *source* package ‘cem’ ...
** R
** data
** inst
** preparing package for lazy loading
Warning in fun(libname, pkgname) :
  Can't find a usable tk.tcl in the following directories: 
    /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/Scripts/tk8.5 /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/Scripts/tk8.5/Resources/Scripts /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/tk8.5 /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/tk8.5/Resources/Scripts ./lib/tk8.5 ./lib/tk8.5/Resources/Scripts ~/Library/Tcl/tk8.5 ~/Library/Tcl/tk8.5/Resources/Scripts /Library/Tcl/tk8.5 /Library/Tcl/tk8.5/Resources/Scripts /System/Library/Tcl/tk8.5 /System/Library/Tcl/tk8.5/Resources/Scripts /System/Library/Tcl/8.5/tk8.5 /System/Library/Tcl/8.5/tk8.5/Resources/Scripts ~/Library/Frameworks/tk8.5 ~/Library/Frameworks/tk8.5/Resources/Scripts /Library/Frameworks/tk8.5 /Library/Frameworks/tk8.5/Resources/Scripts /System/Library/Frameworks/tk8.5 /System/Library/Frameworks/tk8.5/Resources/Scripts ./library



This probably means that tk wasn't installed properly.
** help
*** installing help indices
** building package indices ...
*** tangling vignette sources ...
   ‘cem.Rnw’ 
** testing if installed package can be loaded

How to use CEM? Type vignette("cem")
Warning message:
In fun(libname, pkgname) :
  Can't find a usable tk.tcl in the following directories: 
    /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/Scripts/tk8.5 /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/Scripts/tk8.5/Resources/Scripts /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/tk8.5 /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/tk8.5/Resources/Scripts ./lib/tk8.5 ./lib/tk8.5/Resources/Scripts ~/Library/Tcl/tk8.5 ~/Library/Tcl/tk8.5/Resources/Scripts /Library/Tcl/tk8.5 /Library/Tcl/tk8.5/Resources/Scripts /System/Library/Tcl/tk8.5 /System/Library/Tcl/tk8.5/Resources/Scripts /System/Library/Tcl/8.5/tk8.5 /System/Library/Tcl/8.5/tk8.5/Resources/Scripts ~/Library/Frameworks/tk8.5 ~/Library/Frameworks/tk8.5/Resources/Scripts /Library/Frameworks/tk8.5 /Library/Frameworks/tk8.5/Resources/Scripts /System/Library/Frameworks/tk8.5 /System/Library/Frameworks/tk8.5/Resources/Scripts ./library



This probably means that tk wasn't installed properly.

* DONE (cem)

The downloaded packages are in
	‘/private/var/folders/q5/q5YCJSnWH7arB5jzTZBIf++++TI/-Tmp-/RtmptU5v1f/downloaded_packages’





#Session info

sessionInfo()

R version 2.14.1 (2011-12-22)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base    




#Loading CEM and trying to execute a function

library(cem) #Version 1.0.218

Loading required package: nlme
Loading required package: lattice
Loading required package: randomForest
randomForest 4.6-6
Type rfNews() to see new features/changes/bug fixes.
Loading required package: tcltk
Loading Tcl/Tk interface ... 




#If I try to execute any function a crash occurs




#Error code that I

Resulting error message:

 *** caught segfault ***
address 0x11000080, cause 'memory not mapped'

Traceback:
 1: sys.parent()
 2: sys.function(sys.parent())
 3: formals(sys.function(sys.parent()))
 4: match.arg(type)
 5: sink()
 6: args(cem)
 7: print(args(cem))
 8: eval(expr, envir, enclos)
 9: eval(expr, pf)
10: withVisible(eval(expr, pf))
11: evalVis(expr)
12: capture.output(print(args(cem)))
13: paste(capture.output(print(args(cem))), collapse = "")
14: gsub("\\s+", " ", paste(capture.output(print(args(cem))), collapse = ""))
15: doTryCatch(return(expr), name, parentenv, handler)
16: tryCatchOne(expr, names, parentenv, handlers[[1L]])
17: tryCatchList(expr, classes, parentenv, handlers)
18: tryCatch(expr, error = function(e) {    call <- conditionCall(e)    if (!is.null(call)) {        if (identical(call[[1L]], quote(doTryCatch)))             call <- sys.call(-4L)        dcall <- deparse(call)[1L]        prefix <- paste("Error in", dcall, ": ")        LONG <- 75L        msg <- conditionMessage(e)        sm <- strsplit(msg, "\n")[[1L]]        w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")        if (is.na(w))             w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],                 type = "b")        if (w > LONG)             prefix <- paste(prefix, "\n  ", sep = "")    }    else prefix <- "Error : "    msg <- paste(prefix, conditionMessage(e), "\n", sep = "")    .Internal(seterrmessage(msg[1L]))    if (!silent && identical(getOption("show.error.messages"),         TRUE)) {        cat(msg, file = stderr())        .Internal(printDeferredWarnings())    }    invisible(structure(msg, class = "try-error", condition = e))})
19: try(gsub("\\s+", " ", paste(capture.output(print(args(cem))),     collapse = "")), silent = TRUE)

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace


Thanks for your help,
Daniel



More information about the R-help mailing list