mwDateRange: Add a date range picker to a manipulateWidget gadget

Description Usage Arguments Value See Also Examples

View source: R/inputs.R

Description

Add a date range picker to a manipulateWidget gadget

Usage

1
2
3
4
5
6
mwDateRange(
  value = c(Sys.Date(), Sys.Date() + 1),
  label = NULL,
  ...,
  .display = TRUE
)

Arguments

value

Vector containing two dates (either Date objects pr a string in yyy-mm-dd format) representing the initial date range selected.

label

Display label for the control. If NULL, the name of the corresponding variable is used.

...

Other arguments passed to functiondateRangeInput

.display

expression that evaluates to TRUE or FALSE, indicating when the input control should be shown/hidden.

Value

An Input object

See Also

Other controls: mwCheckboxGroup(), mwCheckbox(), mwDate(), mwGroup(), mwNumeric(), mwPassword(), mwRadio(), mwSelectize(), mwSelect(), mwSharedValue(), mwSlider(), mwText()

Examples

1
2
3
4
5
6
7
8
9
if (require(dygraphs) && require(xts)) {
  mydata <- xts(rnorm(365), order.by = as.Date("2017-01-01") + 0:364)

  manipulateWidget(
    dygraph(mydata) %>% dyShading(from=period[1], to = period[2], color = "#CCEBD6"),
    period = mwDateRange(c("2017-03-01", "2017-04-01"),
                  min = "2017-01-01", max = "2017-12-31")
  )
}

manipulateWidget documentation built on Oct. 5, 2021, 9:10 a.m.