Question

In: Statistics and Probability

how do you insert R input into a word document?

how do you insert R input into a word document?

Solutions

Expert Solution

you can use writedoc(Rdatafile, file = “Rdatafile.docx”) command to insert R input to word file

Let say you want to save your data in to file ‘Rdatafile.docx’ on your desktop (C:\Users\UserName\Desktop).

below R code will help, made appropriate modification as per you’re your data.

# Install the ‘WordR’ & ‘ReporteRs’ package

library(WordR)

library(ReporteRs)

library(ggplot2)

Output <- data Output                            # This is R input you want to insert in word file

Plt <- Plot(data)                                       # This is R plot you want to insert in word file

Rdatafile <- docx()

Rdatafile <- addFlexTable(Rdatafile,FlexTable= Output )

Rdatafile <- addPageBreak(Rdatafile)

Rdatafile <- addParagra(Rdatafile, value = "", stylename= "Normal")

Rdatafile <- addPlot(Rdatafile, plt, height = 4)

writedoc(Rdatafile, file = “Rdatafile.docx”)


Related Solutions

Create a Word document and title it “College Expenses”. In the Word document, insert a table with at least 5 rows and 5 columns. Insert>Table.
Assignment 3 – Incorporating a Table into a Document.Create a Word document and title it “College Expenses”. In the Word document, insert a table with at least 5 rows and 5 columns. Insert>Table.Tell me about your college expenses you have by filling this table with subjects and data. Then write two paragraphs telling me about the information you provided in the table. Bold and color table heading.  Example of table:College ExpensesTuitionBooksComputer/InternetOther suppliesScience ClassMath classC.I.S. ClassEnglish ClassGive the page a proper title....
how do I copy my word data to excel I typed my report on word document...
how do I copy my word data to excel I typed my report on word document and would like to copy them on excel 2013 in other to add table and graph
What supplies do you need? How do you measure how far to insert the NG tube?...
What supplies do you need? How do you measure how far to insert the NG tube? Why would a patient need a NG tube inserted? What position should the patient be in? What education are you going to give before, during, and after the procedure? What are three ways we can use to ensure proper placement of the NG tube? How did you do while practicing? Did you forget anything? Did you ID your patient and ask allergies?
VBA In this assignment you will create a Word Macro-Enabled Document. The document will contain procedures...
VBA In this assignment you will create a Word Macro-Enabled Document. The document will contain procedures with the following declarations: • Sub Main() • Sub GetGrades(grades() As Integer, total As Integer) • Sub CreateOutput(className As String, grades() As Integer, total As Integer) The Main sub-procedure will be the macro that initializes the task. In this procedure you will declare all necessary variables, prompt the user to enter the name of the class and the number of students, resize the grades...
Create a Word document that outlines how your ETL Process works. This document should be written...
Create a Word document that outlines how your ETL Process works. This document should be written as a technical support document that new hire can read to understand what the process does and technicians might use to troubleshoot the process. Include screen shots,
How do I input this in R studio 1. Combine the following lists into a matrix...
How do I input this in R studio 1. Combine the following lists into a matrix called animals, where each list becomes a row: Cats = 2,2,4 Dogs = 1,2,1 Cows = 30,35,41 2. Add column names of “Farm A”, Farm B”, and “Farm C”. 3. Transpose the rows and columns in animals and store the result to a matrix called farms. 4. Display the contents of farms.
On a new Word document, write 4 - 5 paragraphs describing how you want to organize...
On a new Word document, write 4 - 5 paragraphs describing how you want to organize your assisted living facility business and how management will be structured. Your paragraphs should include the following: A brief overview of the type of organization structure you will have (as each health care facility is structured differently, whether a hospital, private practice or department) A list of the major positions within your health care organization and their responsibilities. A description of the type of...
Compose a Word document thatanswers the following questions.What is considered anoutbreak?How to...
Compose a Word document that answers the following questions.What is considered an outbreak?How to investigate a disease outbreak?
In your own word, what do you understand by the word "Civilization"? How many types of...
In your own word, what do you understand by the word "Civilization"? How many types of Constitutions can you think of?
please do on word document Q1 The following selected account balances for the year ended December...
please do on word document Q1 The following selected account balances for the year ended December 31 are provided for Amita Company: Purchases of raw materials                                                                                                                   $260,000 Direct labour                                                                                                                                                           65,000 Maintenance, factory                                                                                                                                         74,000 Selling and administrative salaries                                                                                                              179,000 Depreciation, factory equipment                                                                                                          110,000 Cleaning supplies                                                                                                                                                  6,000 Sales commissions                                                                                            350,000 Utilities, factory building                                                                                     52,000 Rent, factory                                                                                                                                                           90,000 Depreciation, sales equipment                                                                             80,000 Insurance, factory equipment                                                                                                                             8,000 Advertising expense                                                                                          300,000 In addition, you have the following information about inventories during the year: Increase in raw materials        $10,000 Decrease in work in process   $15,000 Beginning finished goods       $30,000           (1,000 units) Ending...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT