factcircuit
FactCircuit는 불변 출처와 단계별 검증, 제한된 검색, 재현 가능한 평가를 제공하는 감사 가능한 주장·증거 검증 루프입니다
대각선으로 셀을 나눠 두 행렬을 하나의 히트맵에 시각화합니다
Visualizes two numeric matrices of identical shape in a single heatmap by splitting each cell along a diagonal. The upper triangle encodes one matrix (default white to red) and the lower triangle enco
데이터R · CSSGitHub @gcol33온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기Visualizes two numeric matrices of identical shape in a single heatmap by splitting each cell along a diagonal. The upper triangle encodes one matrix (default white to red) and the lower triangle encodes the other (default white to blue). Useful for compact paired comparisons such as observed vs. predicted, mean vs. variance, correlation vs. significance, or train vs. test performance. Built on ggplot2.
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
README 전문 보기 ↗two matrices in one heatmap
BiHeat draws two numeric matrices of the same shape in one heatmap, such as observed and predicted values, a mean and its variance, or correlations and their p-values.
Each cell is split along a diagonal. The upper triangle shows the value from one matrix and the lower triangle the value from the other, each on its own colour gradient, and the plots are built with ggplot2. Both values for a row and column sit in the same cell, so you can see where the two matrices agree and where they differ, and decide which cells to look at more closely.
BiHeat supports:
breed()
aligns the two on their shared names and reports the Pearson and
Spearman correlation, RMSE, MAE and the number of missing cells.geom_biheat()
draws the same cells as a layer, so facets, coordinate systems and
other layers work as usual, and the fill scale stays free for them.bi_legend() returns the paired
colour key as a standalone grob, for figures where the panel is
assembled separately.Other packages draw related displays.
corrplot has
corrplot.mixed(), which draws one display above the diagonal of a
correlation matrix and another below it.
ComplexHeatmap can
split a cell through a custom cell_fun, alongside its clustering and
annotation tools. BiHeat splits every cell of two plain matrices and
gives each half its own gradient.
# install.packages("pak")
pak::pak("gcol33/BiHeat")
biheat().breed(), set rendering
options with incubate() and draw with plot().comes_out().library(BiHeat)
set.seed(1)
species <- LETTERS[1:6]
sites <- letters[1:8]
observed <- matrix(runif(48), 6, 8, dimnames = list(species, sites))
noise <- matrix(rnorm(48, sd = 0.1), 6, 8)
predicted <- observed + noise
biheat(observed, predicted)
The first matrix fills the upper triangle (white to red) and the second the lower triangle (white to blue). Where the two disagree, the halves of a cell differ in shade.
The input is two numeric matrices. Where both carry row or column names, they are matched on the names they share; an axis without names on both sides is matched by position and needs the same length. Getting started with BiHeat describes how the matrices are aligned and how missing cells are drawn.
biheat() is a shortcut for three steps. breed() pairs the two
matrices into a clutch, an object holding both matrices aligned on their
shared names together with their comparison statistics:
clutch <- breed(observed, predicted)
clutch
#> <clutch>
#> upper: observed (6 x 8)
#> lower: predicted (6 x 8)
#> align: intersect (6 rows x 8 cols kept)
#> cells: 48 finite / 48 total (0 NA)
#> pearson: 0.955 rmse: 0.0908 mae: 0.0693
incubate() adds rendering options to a clutch, and each call adds to
the options set before. plot() draws it:
clutch |>
incubate(scale = "shared", split = "up") |>
plot()
The verbs take a clutch and return one, so they chain. switch_sides()
swaps which matrix is on top, straighten() flips the direction of the
diagonal and bothways() toggles between separate and shared colour
scales:
clutch |>
switch_sides() |>
straighten() |>
bothways() |>
plot()
scale = "separate" (the default) gives the upper and lower triangles
their own ranges. Use it when the two matrices measure different
things, such as a correlation and its p-value or a mean and its
variance.scale = "shared" puts both triangles on one range, so the colours of
the two halves can be compared directly. Use it when the matrices are
in the same units, such as observed and predicted values or the
accuracy of two models.Styling and layout covers palettes, printed values, cell geometry, skewed values and the order of rows and columns.
geom_biheat() draws the split cells as a ggplot2 layer from a data
frame with one row per cell, which is the shape comes_out() returns:
library(ggplot2)
cells <- comes_out(clutch)
ggplot(cells, aes(col, row, upper = upper, lower = lower)) +
geom_biheat() +
theme_biheat()
Each triangle carries its own gradient, so neither uses the fill
scale, which stays free for another layer. Split cells inside a
ggplot
shows faceting, continuous axes and layers drawn on top.
Start with Getting started with
BiHeat: from two
matrices to a split heatmap, how the matrices are aligned and what
plot() returns.
geom_biheat() layer with facets, continuous axes and other
layers.Questions and bug reports go to the GitHub issues. A bug report is easiest to act on with a small reproducible example, for instance made with reprex.
“Software is like sex: it’s better when it’s free.” — Linus Torvalds
I’m a PhD student who builds R packages in my free time because I believe good tools should be free and open. I started these projects for my own work and figured others might find them useful too.
If this package saved you some time, buying me a coffee is a nice way to say thanks. It helps with my coffee addiction.
BiHeat is licensed under MIT.
Colling G (2026). _BiHeat: Diagonally Split Heatmaps for Paired Matrix
Visualization_. R package version 0.1.0,
<https://gillescolling.com/BiHeat/>.
BibTeX:
@Manual{colling2026biheat,
title = {BiHeat: Diagonally Split Heatmaps for Paired Matrix Visualization},
author = {Gilles Colling},
year = {2026},
note = {R package version 0.1.0},
url = {https://gillescolling.com/BiHeat/},
}