0

I have a table that looks like this after creating several metrics and rbinding them together:

|Metric                         |        Today|          T-1|          T-7|  
|:------------------------------|------------:|------------:|------------:|   
|Int_Metric_1                   |  550.0000000|  609.0000000| 1227.0000000|   
|Int_Metric_2                   | 5633.0000000| 5873.0000000| 7252.0000000|  
|Pct_Metric_1                   |    0.3127273|    0.2807882|    0.2738386|  
|Pct_Metric_2                   |    0.7763975|    0.7667695|    0.7340162|  
|Pct_Metric_3                   |    0.7625726|    0.7511565|    0.7003139|

The Pct_Metric's were actually in percent() format before rbinding, and the int_metrics were integer format; but after rbinding they all became numbers after rbinding them together.

Is there a way to convert the int_metrics to integers, and the pct_metrics to percentages within the same data frame, so that I can create a table out of this?

Sotos
  • 51,121
  • 6
  • 32
  • 66
Jason J
  • 110
  • 2
  • 7
  • Welcome to StackOverflow! Please read the info about [how to ask a good question](http://stackoverflow.com/help/how-to-ask) and how to give a [reproducible example](http://stackoverflow.com/questions/5963269). This will make it much easier for others to help you. – Sotos Jul 10 '18 at 06:34
  • 4
    You can't have 2 types in a single column. You can achieve what you need If you transpose the data frame and then change to the required type – Sotos Jul 10 '18 at 06:36
  • look for `knitr` package where in you can create a table the way you want. – Prem Jul 10 '18 at 07:03
  • 1
    Thanks all. Looks like I can convert all values to characters before rbind. – Jason J Jul 10 '18 at 07:05

0 Answers0