to_js_array | R Documentation |
to_js_array()
takes a tibble with a grouping column and columns that are to be combined into a js array.
to_js_array(.data, .grp_var, ..., array_name)
.data |
tibble; data with grouping column and columns to be used to create the js array column |
.grp_var |
grouping column |
... |
columns in .data that are to be used to create the js array column |
array_name |
string; name of the newly created js array column |
The js array column that's created is list column of form <array_name> = list(list(array_var1=var1val1, array_var2 = var2val1, ...), list(array_var1=var1val2, array_var2=var2val2, ...), ...) for each grouping variable category.
I like to use the dataui package along with the reactable package. dataui
is still in more of a developmental phase and requires the data to be in this js array like format.
tibble with grouping column and js array column
head(indiana_pos_rate)
pos_rate_array <- to_js_array(.data = indiana_pos_rate,
.grp_var = msa,
end_date, pos_rate,
array_name = "posList")
head(pos_rate_array)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.