loadNamespace(名称)Cairo中的错误

时间:2016-07-05 16:03:52

标签: python r jupyter cairo

这是我第一次在find.next.smaller <- function(ini = 1, vec) { if(length(vec) == 1) NA else c(ini + min(which(vec[1] > vec[-1])), find.next.smaller(ini + 1, vec[-1])) } # the recursive function will go element by element through the vector and find out # the index of the next smaller value. df %>% group_by(item) %>% mutate(next.smaller.day = day[find.next.smaller(1, val)], next.smaller.day = replace(next.smaller.day, is.na(next.smaller.day), -1)) # Source: local data frame [6 x 4] # Groups: item [2] # # item day val next.smaller.day # <int> <int> <dbl> <dbl> # 1 1 2 2 5 # 2 1 4 3 5 # 3 1 5 1 -1 # 4 2 1 1 -1 # 5 2 3 2 -1 # 6 2 5 3 -1 中使用R。我安装了jupyterjupyterpythonR等所有内容。我只能在jupyter中使用输入或计算,但每当我想使用像lRkernelplot这样的图表库时,它就会显示

  

loadNamespace(name)出错:没有名为'Cairo'的包   回溯:没有标题的情节

有人请指导我如何处理这个问题。

1 个答案:

答案 0 :(得分:1)

我有完全相同的问题,并通过安装Cairo包修复它: install.packages("Cairo")` library(Cairo) 感谢我的同事Bartek提供此解决方案