From the course: R Programming in Data Science: High Variety Data

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Write ranges to Excel

Write ranges to Excel

From the course: R Programming in Data Science: High Variety Data

Start my 1-month free trial

Write ranges to Excel

- [Instructor] If you're working with a team, it's not going to be uncommon for you to have to write your data into someone else's workbook. And to do that, it's very convenient to be able to write to a range rather than to an entire worksheet, or to overwrite a large amount of data. R provides a way to do that. The easiest way to do this is to use the open Excel SX package, create a range, read the file, create the range, and then save the file back out. So let's take a look at those three steps. The first thing I want to do is create data that I want to write out to that Excel workbook. So I'm going to create a small table for range, and this is just a simple data frame that contains this thing, that thing, and another thing. Now I need to bring in the workbook that I want to add data to, and to do that I'll use open Excel SX, if you haven't already installed the package, do so, and use the library command to make that package active. Now I'm going to bring that file in and put it…

Contents