0

the text book chapter on inline formatting does not have much on how to format the results of inline code as follows in my .rmd:

training set has r n_[1] rows and r n_[2] columns which is a matrix with r n_[1] * n_[2] entries while only r dim(fulldataset)[1] / (n_[1] * n_[2]) items are rated.

the inline code in above is using a pair of backticks. This produces the following when knitted:

training set has 69878 rows and 10677 columns which is a matrix with 746087406 entries while only 0.0120630035135588 items are rated.

i'd like # rows & columns to be formatted with comma and the last expression as %. I do not seem to find any relevant thread on this.

GregV
  • 514
  • 2
  • 18

1 Answers1

1

Just use the answers in this thread to wrap your calculations in your inline code How to format a number as percentage in R?

Kyle Safran
  • 443
  • 3
  • 8