O'Reilly logo

R Data Analysis Cookbook - Second Edition by Kuntal Ganguly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

There are multiple options for reading and saving a worksheet. Let's look at a few examples.

Step 1 saves the auto data frame to a new worksheet called autobase and creates the Excel file. If we do not include row.names=FALSE, the row numbers are displayed as the first column in the spreadsheet.

Step 2 adds two additional columns to the auto data frame. The first column kmpg is kilometers per gallon, and the second new column is the mean mpg deviation. We used vector operations to compute the columns.

Step 3 shows the following functions to create workbooks, worksheets, rows, and cells:

  • createWorkbook: This creates a workbook object and returns a reference to the object.
  • createSheet: This creates a worksheet and gives it ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required