extension.json
) and R script file (extension.r
). These two files need to be stored inside a zip file as follows.<extension_name>.zip
<extension_name>/extension.json
<extension_name>/scripts/extension.r
tidyquant_example
, and scripts
directory below it. NOTE: The directory name is the data source extension name and should be unique among user-defined data source extensions.extension.r
with following content. This is defining a function execute_tidyquant
, which gets stock prices data through tq_get
function of tidyquant
package.tq_get
function of tidyquant
), use explicit namespace like tidyquant::tq_get
. This makes sure that your function gets access to the package function when used inside Exploratory.extension.r
under tidyquant_example/scripts
.extension.json
) looks like. The file must be in valid JSON format.extension.json
under tidyquant_example
directory.name
attribute holds Name of the data source extension. in this case my_riem_measures
, please make sure to use your directory name for this name
attribute.displayName
attribute is used for Display Name on Data Source Extension Picker Dialog and Import Data Dialog.iconURL
holds icon image file URL for your data source extension. currently it only supports external URL.iconWidth
and iconHeight
are set to 32px by default to fit icon in the UI. If you want to change it for some reason, you can change these by specifying following attributes.helpURL
holds URL for your data source extension help page. Help Link is put on Import Dialog Header. If you do not have one, you can set default exploratory doc link like below:packages
is an array of package name and version pairs that the data source extension depends. For example, if you data source extension depends on tidyquant
you need to set it like below:function
holds R function name that the data source extension calls to get data. The R function must return a data frame as output. In this example, you'll call riem_measures
from riem package.rSourceFile
holds the name of R script file that the data source extension depends. Let's use extension.r
for this example.hasQueryField
as true
and add a parameter whose name
is query
and dataType
is text.extension.json
inputParameters
is an array of parameters passed to the function
(i.e in this case, execute_tidyquant
) and these are rendered as input fields on Data Import Dialog. Parameter order matters. Make sure to set input parameters in a way that underlying R function expects. For example, if your R function has arguments stocks
and from
, then you need to define your inputParameters in this order.(i.e stocks
, then, from
).withName
as true. By setting it true, this argument is used with its name as key in R function. For example, if you have withSentiment
parameter and set withName
as true,name
of the input parameter.displayName
attribute is used for Parameter Display Name on Import Data Dialog.dataType
attribute holds a type of the input parameter. Supported types are:text
, it becomes input field that accepts characters.options
and itemDataType
like below. options
is an array of selector options and each option needs to have label
and value
attributes. If your option value is text, itemDataType
should be set as text
. If your option value is number, itemDataType
should be number. Date is not supported for itemDataType
for now. To set default selection, you can set your default value to defaultValue
attribute. If you want to pass NULL
to underlying R function, set value
as null
in your JSON file.listOfValues
like below. listOfValues
is an array of list of values option and each option needs to have name
and displayName
attributes.number
, it becomes input field that accepts numeric value.boolean
, you can define a list of values with two values (i.e. true/false)defaultValue
attribute.true
if you want to make this argument as "named" parameter. See inputParameter for details.isStringArray
as true. In this case, user enters comma(,) separated values in a input field and Data Source Extension Framework convert it to c("a", "b", "c")
fashion.placeholder
attribute. For example, if you want your user to type in multiple values with comma(,) separated way, then you can define placeholder
attribute to the input parameter.required
attribute as true
. By setting this to true
, you can force users to enter values for these parameters and if a user clicks Get Data
button without filling these parameters, he/she gets following error on Import Dialog.tidyquant_example.zip
.Import Extension Data
after clicking + (plus)
icon next to Data Frames
.Historical Stock Prices