19
---
title: '1'
author: "A"
date: "April 4, 2017"
output: html_document
---

      Figure 3 includes the residual plot and QQ-plot. The residual plot have no obvious pattern: the expect value of residuals is close to 0 and the variances are approximately equal. The QQ-plot shows the standardized residuals are close to the theoretical quantiles. Thus, **the residuals are normally distributed and homoscedastic, and the assumption of the liner model is satisfied**. The VIF values for each variable in the best model is small, indicating **there are no obvious multicolinearity**.

Use the above code for example, as it shows in the picture, the second line and third line are aligned to the left by default.

enter image description here

What should I do if I want to align to both sides? (Notice: not align to the center!)

Text Justification in Rmarkdown word document gives the solution for word output case, but I haven't found a good reference for html case.

Community
  • 1
  • 1
Bin
  • 517
  • 1
  • 4
  • 15

1 Answers1

41

Just overwrite the alignment right after the YAML:

---
title: '1'
author: "A"
date: "April 4, 2017"
output: html_document
---

<style>
body {
text-align: justify}
</style>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Figure 3 includes the residual plot and QQ-plot. The residual plot have no obvious pattern: the expect value of residuals is close to 0 and the variances are approximately equal. The QQ-plot shows the standardized residuals are close to the theoretical quantiles. Thus, **the residuals are normally distributed and homoscedastic, and the assumption of the liner model is satisfied**. The VIF values for each variable in the best model is small, indicating **there are no obvious multicolinearity**.

Credits to Guilherme Parreira, here

miguelsj
  • 423
  • 4
  • 7