在R

时间:2015-08-04 09:51:36

标签: r error-handling

我有一个数据框,其中一列带有一个列表变量。 list变量包含我想要删除的重复元素。以下是我正在使用的代码:

library(gsubfn)

Loading required package: proto
Could not load tcltk.  Will use slower R code instead.

resp$secu <- as.character(lapply(strapply(resp[[7]], "\\w")), unique)

我在mac上使用R 3.2.0版本。我尝试手动加载tcltk但没有成功:

library(tcltk)
Error : .onLoad failed in loadNamespace() for 'tcltk', details:
  call: fun(libname, pkgname)
  error: X11 library is missing: install XQuartz from xquartz.macosforge.org
Error: package or namespace load failed for ‘tcltk’

我卸载了库tcltk并尝试重新安装但不能:

Warning in install.packages :
  package ‘tcltk’ is not available (for R version 3.2.0)

我可以执行代码并且R启动时没有任何错误消息。但是花了一个小时才能获得65k行列表来删除重复项并且处理尚未完成。有没有办法在不使用tcltk库的情况下提高strapply的速度?

0 个答案:

没有答案