sensebox / opensensmapR

R client for opensensemap.org
https://noerw.github.io/opensensmapR/inst/doc/osem-history
8 stars 5 forks source link

Expose default mar setting for plotting measurements #12

Closed nuest closed 6 years ago

nuest commented 6 years ago

It's quite handy to have a default plotting function, but it would be even better if users could change mar when calling the function. Untested (!) idea:

plot.osem_measurements = function (x, mar = c(2,4,1,1), ...) {
  oldpar = par()
  par(mar = mar)
  plot(value~createdAt, x, col = factor(x$sensorId), xlab = NA, ylab = x$unit[1], ...)
  par(mar = oldpar$mar)
  invisible(x)
}