Is it possible to use column name instead of currency character in R's datatable formatCurrency?

Viewed 28

From the docummentation, the currency argument requires the currency symbol. However, is it possible I have for example with a dataframe like this:

x <- data.frame(
  spend = c(1000, 500, 400),
  currency = c("GBP", "EUR", "GBP")
)

I want the spend column in dt to be shown with the currency symbol accordingly. Is it possible to do that with R's datatable?

0 Answers
Related