From e07a72a143865e3ccfa57207ebc747dba362a76b Mon Sep 17 00:00:00 2001 From: Karl Broman Date: Sun, 31 May 2020 09:49:28 -0500 Subject: [PATCH] itriplot: take labels from column names --- DESCRIPTION | 4 ++-- NEWS.md | 5 ++++- R/itriplot.R | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index f1fb4637..c7a1ce6d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: qtlcharts -Version: 0.12-4 -Date: 2019-12-19 +Version: 0.12-5 +Date: 2020-05-31 Title: Interactive Graphics for QTL Experiments Author: Karl W Broman [aut, cre] (), Michael Bostock [ctb, cph] (d3.js library in htmlwidgets/lib, diff --git a/NEWS.md b/NEWS.md index dec124ba..5f36fd41 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,7 @@ -## qtlcharts 0.12-4 (2019-12-19) +## qtlcharts 0.12-5 (2020-05-31) + +- `itriplot()` will take labels from the column names of the + probabilities, `p`. - Allow `title` as chart option in `iplotMScanone()`, `iplotScanone()`, `iheatmap()`. diff --git a/R/itriplot.R b/R/itriplot.R index 6cc144c8..7e65ec47 100644 --- a/R/itriplot.R +++ b/R/itriplot.R @@ -43,6 +43,10 @@ function(p, indID=NULL, group=NULL, chartOpts=NULL, digits=5) stopifnot(length(indID) == n) indID <- as.character(indID) + if(!is.null(colnames(p))) { # if column names for probabilities, use as labels + chartOpts <- add2chartOpts(chartOpts, labels=colnames(p)) + } + if(is.null(group)) group <- rep(1, n) group_levels <- sort(unique(group)) group <- group2numeric(group)