I'm using 'data.table' package and trying to use the formatting prints functions of the package. I want to present some of the columns as Currency and some as Percentage, But I got an error when specifying the table column names. my data :
str(dt) :
when trying to apply:
dt %>% formatCurrency(c('A','E'))
"Error in name2int(name, names, rownames) : You specified the columns: A, E, but the column names of the data are "
edit: this issue can be re-created by:
tmp = data.table('A' = rep(1:10),'B' = rep(11:20))
tmp %>% formatPercentage(c('A','B'),2)