initialize,DataSet-method {rAmCharts} | R Documentation |
Creates or updates a DataSet
Description
Uses the constructors to create the object with its properties or updates an existing one with the setters.
Usage
## S4 method for signature 'DataSet'
initialize(
.Object,
compared = FALSE,
dataProvider,
fieldMappings,
stockEvents,
...
)
dataSet(compared = FALSE, dataProvider, fieldMappings, stockEvents, ...)
## S4 method for signature 'DataSet,ANY,ANY'
setDataProvider(.Object, dataProvider, keepNA = TRUE)
setFieldMappings(.Object, fieldMappings)
## S4 method for signature 'DataSet,list'
setFieldMappings(.Object, fieldMappings)
addFieldMapping(.Object, ...)
## S4 method for signature 'DataSet'
addFieldMapping(.Object, ...)
setStockEvents(.Object, stockEvents)
## S4 method for signature 'DataSet,list'
setStockEvents(.Object, stockEvents)
addStockEvent(.Object, stockEvent = NULL, ...)
## S4 method for signature 'DataSet,StockEventOrMissing'
addStockEvent(.Object, stockEvent = NULL, ...)
Arguments
.Object |
|
compared |
|
dataProvider |
|
fieldMappings |
|
stockEvents |
|
... |
other properties of DataSet. |
keepNA |
|
stockEvent |
StockEvent.
Argument for method |
Value
(updated) DataSet object
Examples
new("DataSet")
dataSet(categoryField = "categoryField")
setDataProvider(.Object = dataSet(), data.frame(key = c("FR", "US"), value = c(20,10)))
dataset <- addFieldMapping(.Object = dataSet(),
fieldMappings = list(fromField ="val1", toField ="value"))
print(dataset)
dataset <- addFieldMapping(.Object = dataSet(), fromField ="val1", toField ="value")
print(dataset)
addStockEvent(.Object = dataSet(), backgroundAlpha = 1, backgroundColor = "#DADADA")
# equivalent to:
stockEvent_obj <- stockEvent(backgroundAlpha = 1, backgroundColor = "#DADADA")
chart <- addStockEvent(.Object = dataSet(), stockEvent = stockEvent_obj); print(chart)
[Package rAmCharts version 2.1.15 Index]