我正在尝试使用UpSetR包中的查询功能来突出显示取决于一个变量的某些项目。
我的数据集Dropbox 链接
我可以毫无问题地做一个基本的情节:
stress <- read_delim("upset_plot_high_freq.csv", "\t", escape_double = FALSE, trim_ws = TRUE)
stress_data<-as.data.frame(stress)
upset(stress_data, sets = c("reg_region","sweep","gene_association","chromatin"),
mainbar.y.label = "Number of TEs", sets.x.label = "Total number of TEs",
text.scale = 2, group.by = "degree", order.by="freq")
但是,当我尝试进行一些基本查询时,我会遇到各种错误。例如,在一个基本查询中,我要求将变量中具有给定值的所有元素涂成蓝色,我收到以下错误:
myfunction <- function(row, min){
newData <- (row["chip_num"] > min)
}
upset(stress_data, sets = c("reg_region","sweep","gene_association","chromatin"),
queries = list(query = myfunction, params = list(0), active = TRUE),
mainbar.y.label = "Number of TEs", sets.x.label = "Total number of TEs",
text.scale = 2, group.by = "degree", order.by="freq")
查询 [[i]]$color 中的错误:“闭包”类型的对象不是子集