From 416d986c1102fa3da724d9cf3fb555dab93b023a Mon Sep 17 00:00:00 2001 From: Norwin Roosen Date: Fri, 5 Jan 2018 00:13:53 +0100 Subject: [PATCH] expose mar for plot.osem_measurements(), fixes #12 --- R/measurement_utils.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/measurement_utils.R b/R/measurement_utils.R index 6d5ac76..485e424 100644 --- a/R/measurement_utils.R +++ b/R/measurement_utils.R @@ -1,7 +1,7 @@ #' @export -plot.osem_measurements = function (x, ...) { +plot.osem_measurements = function (x, ..., mar = c(2,4,1,1)) { oldpar = par() - par(mar = c(2,4,1,1)) + par(mar = mar) plot(value~createdAt, x, col = factor(x$sensorId), xlab = NA, ylab = x$unit[1], ...) par(mar = oldpar$mar) invisible(x) @@ -10,6 +10,7 @@ plot.osem_measurements = function (x, ...) { #' @export print.osem_measurements = function (x, ...) { print.data.frame(x, ...) + invisible(x) } #' Converts a foreign object to an osem_measurements data.frame.