How to apply currency format on specific rows in R

590 Views Asked by At

I would like to apply format Currency to row 3 and 4 of this sample data frame. Is it possible to do it by row? I know there are functions (such as DT::formatCurrency) that can do it by column.

Thanks in advance!

Dataset:

A <- c(100, 7, 10000, 2000)
B <- c(150, 8, 21000, 25000)
C <- c(200, 5, 15000, 20000)

df <- data.frame(A, B, C)

Desired output:

enter image description here

0

There are 0 best solutions below