0

Is it possible to include text directly from a file (word document for example) in a R Notebook? I have the following script, but I am not happy with the solution as it includes the text as an output and I wanted the text to be seen like a paragraph:

    ---
title: "R Notebook"
output:
  html_document:
    df_print: paged
  html_notebook: default
  word_document: default
---

This is an [R Markdown](http://rmarkdown.rstudio.com) Notebook. When you execute code within the notebook, the results appear beneath the code. 

Try executing this chunk by clicking the *Run* button within the chunk or by placing your cursor inside it and pressing *Ctrl+Shift+Enter*. 




```{r echo=FALSE}
paste("to reduce illicit and other harmful drug use and to increase the rates of people recovering from dependency. These aims are supported by four key themes that structure the approach being taken: (i) reducing demand; (ii) restricting supply; (iii) building recovery; and (iv) global action. ")
```
Bruno Guarita
  • 767
  • 10
  • 21
  • If you want to import word document you should clearly specify it (it's very different from importing simple text file). – pogibas Aug 02 '18 at 11:00
  • Yes, I need to import from a word document – Bruno Guarita Aug 02 '18 at 11:09
  • 1
    Possible duplicate of [reading and scanning MS Word .doc files in R](https://stackoverflow.com/questions/19491987/reading-and-scanning-ms-word-doc-files-in-r) – jay.sf Aug 02 '18 at 11:22

0 Answers0