Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions R/splinewithsimultaneousconfint.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ SplineWithSimultaneousConfIntervals <- function(outcome,
y.tick.format = NULL,
x.grid.width = 1,
y.hovertext.format = ".1f",
y.zero = FALSE,
title = NULL,
x.title = NULL,
y.title = NULL,
Expand Down Expand Up @@ -168,12 +169,13 @@ SplineWithSimultaneousConfIntervals <- function(outcome,

# Create plot
plot.data <- pred$fit
names(plot.data) <- pred$predictor
names(plot.data) <- if (inherits(pred$predictor, "POSIXct")) strftime(pred$predictor)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should a format be specified for strftime to match what it used to do? Right now does it use the default which is "%Y-%m-%d %H:%M:%S"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strftime uses the correct default. I think previously it was calling as.character which used a different format, but for `strftime the default format is fine.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the format will change for users?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The change affects whether the plotly can correctly parse the dates. If the parsing works, plotly selects nice date defaults (which are the same as before)
image

else pred$predictor
pp <- Line(plot.data, colors = mean.color, line.thickness = mean.weight,
title = title, x.title = x.title, y.title = y.title,
y.tick.format = y.tick.format, y.hovertext.format = y.hovertext.format,
global.font.family = global.font.family, global.font.color = global.font.color,
title.font.size = title.font.size, x.grid.width = x.grid.width,
title.font.size = title.font.size, x.grid.width = x.grid.width, y.zero = y.zero,
y.title.font.size = y.title.font.size, x.title.font.size = x.title.font.size,
y.tick.font.size = y.tick.font.size, x.tick.font.size = x.tick.font.size,
hovertext.font.size = hovertext.font.size, legend.show = FALSE, ...)
Expand Down
3 changes: 3 additions & 0 deletions man/SplineWithSimultaneousConfIntervals.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading