Browse code

list_to_matrix(): convert to character

Zuguang Gu authored on 11/06/2020 13:01:29
Showing2 changed files

... ...
@@ -2121,6 +2121,11 @@ anno_text = function(x, which = c("column", "row"), gp = gpar(),
2121 2121
         }
2122 2122
         
2123 2123
 		grid.text(value[index], location, (n - seq_along(index) + 0.5)/n, gp = gp, just = just, rot = rot)
2124
+		# if(add_lines) {
2125
+		# 	if(n > 1) {
2126
+		# 		grid.segments(0, (n - seq_along(index)[-n])/n, 1, (n - seq_along(index)[-n])/n, default.units = "native")
2127
+		# 	}
2128
+		# }
2124 2129
 	}
2125 2130
 	column_fun = function(index, k = NULL, N = NULL, vp_name = NULL) {
2126 2131
 		n = length(index)
... ...
@@ -323,7 +323,7 @@ list_to_matrix = function(lt, universal_set = NULL) {
323 323
 	rownames(mat) = sort(universal_set)
324 324
 	colnames(mat) = names(lt)
325 325
 	for(i in seq_along(lt)) {
326
-		mat[unique(lt[[i]]), i] = 1
326
+		mat[as.character(unique(lt[[i]])), i] = 1
327 327
 	}
328 328
 	return(mat)
329 329
 }