Shiny as Excel Replacement: Ad Hoc Calculations

Hi all,

I want to introduce Shiny apps in a corporate environment, and for many things like filtering we can very easily replace or even improve Excel's functionalities. The only thing the business users are really missing is a quick and easy column calculation function, like in Excel when you multiply column A times B and substract C, or something similar.

Has somebody seen a nice implementation for that in Shiny, or how would you go about that conceptually? Just a rough sketch of what I should look into would be very nice already!


It is possible to have the user enter R expressions as text and then evaluate them at runtime. You could possibly use this inside a DT::dataTable or similar control (e.g. rhandsontable) to allow custom calculations. This particular example caries a security warning though.

1 Like

You can get that kind of simple spreadsheet functionality on shiny with excelR package, it allows you to use simple formulas like =A1+B1-C1


Thanks, the ExcelR package seems like a nice idea, I will take a look at that for future dashboards. As my current implementation is based on the DT package, I will probably introduce column headers (like A, B, C ,D ) on top of the column names, and will use that to allow some pseudo code like calculations.

Any other ideas that are compatible with a DT implementation?`

@woodward thanks I will see how business users will use R here, or whether I provide a simple interface for just the arithmetic operations.

Thanks so far!

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.