Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Extending Excel with Python and R

You're reading from  Extending Excel with Python and R

Product type Book
Published in Apr 2024
Publisher Packt
ISBN-13 9781804610695
Pages 344 pages
Edition 1st Edition
Languages
Authors (2):
Steven Sanderson Steven Sanderson
Profile icon Steven Sanderson
David Kun David Kun
Profile icon David Kun
View More author details

Table of Contents (20) Chapters

Preface Part 1:The Basics – Reading and Writing Excel Files from R and Python
Chapter 1: Reading Excel Spreadsheets Chapter 2: Writing Excel Spreadsheets Chapter 3: Executing VBA Code from R and Python Chapter 4: Automating Further – Task Scheduling and Email Part 2: Making It Pretty – Formatting, Graphs, and More
Chapter 5: Formatting Your Excel Sheet Chapter 6: Inserting ggplot2/matplotlib Graphs Chapter 7: Pivot Tables and Summary Tables Part 3: EDA, Statistical Analysis, and Time Series Analysis
Chapter 8: Exploratory Data Analysis with R and Python Chapter 9: Statistical Analysis: Linear and Logistic Regression Chapter 10: Time Series Analysis: Statistics, Plots, and Forecasting Part 4: The Other Way Around – Calling R and Python from Excel
Chapter 11: Calling R/Python Locally from Excel Directly or via an API Part 5: Data Analysis and Visualization with R and Python for Excel Data – A Case Study
Chapter 12: Data Analysis and Visualization with R and Python in Excel – A Case Study Index Other Books You May Enjoy

Packages to write into Excel files

In this section, we are going to go over a few different libraries that we can use to write data.frames/tibbles to Excel files. We are going to use the writexl, openxlsx, and xlsx libraries.

In the following section, we are going to list each package, specify where you can find the function documentation that writes the data to Excel, and go over the functions’ parameters.

writexl

The writexl package is part of the rOpenSci consortium and can be found here: https://docs.ropensci.org/writexl/reference/write_xlsx.html.

The library does not require Java or Excel to work.

The function that writes the data to Excel is write_xlsx(). Let’s go over the different parameters of the function and look at a full pseudo function call.

First, let’s look at the function call itself – that is, write_xlsx():

write_xlsx(
  x,
  path = tempfile(fileext = ".xlsx"),
  col_names = TRUE...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}