One of reasons to use R is to avoid using Excel for complex data processing. But, this does not mean one should not use Excel at all. There are some good reasons for it, including communication with non-coding co-workers being probably the most important of them all. To ensure smoothness of workflow consisting of analysis with R and results sharing via Excel, it is necessary to be able to manipulate XLSX files within R. openxlsx
is a great help with this.
This is the second part of series on creating XLSX files. For other parts, follow the tag openxlsx.
Answers to these exercises are available here.
If you obtained a different (correct) answer than those listed on the solutions page, please feel free to post your answer as a comment on that page.
Exercise 1
Load openxlsx
. Create an openxlsx
workbook.
Exercise 2
Set the global option for openxlsx
`s formatting of numerics to be two decimal places.
Exercise 3
Add a new worksheet to the workbook.
Exercise 4
Create the iris
data as an excel table in the worksheet, starting at column B
.
- Learn some of the differences between working in Excel with regression modeling and R
- Learn about different statistical concepts
- And much more
Exercise 5
Freeze the first row (columns/names.)
Exercise 6
Format the first column of the data to highlight green when a value is greater than 5.
Exercise 7
Set the width of the columns to 20.
Exercise 8
Create a worksheet without gridlines and add some iris
density plot to it, starting at row 2.
Exercise 9
At row 1, add a hyperlink to the article about the iris
data-set in Wikipedia.
Exercise 10
Save the workbook to a file.
Leave a Reply