update_spreadsheet_2: R_interact_excel 2

Description Usage Arguments Examples

Description

Allows a spreadsheet to be modified programatically and the outputs captured. Uses the RDCOMClient, dplyr and stringr packages

Usage

1
2
3
update_spreadsheet_2(file_location = NULL, sheet = "Sheet1",
  input_values = NULL, input_cells = NULL, output_cells = NULL,
  save_spreadsheet = "new_spreadsheet.xls", wb = NULL)

Arguments

file_location

file location of the spreadsheet to modify. The spreadsheet should be .xls format

sheet

the sheet name. Defaults to Sheet1

input_values

a vector of values corresponding to the cells to be modified

input_cells

a character vector of the input cells in the form c('A1', 'A2')

output_cells

the cells from which the output will be read

save_spreadsheet

if ' ' then will overwrite the current spreadsheet. If NULL will not save. If any other name, will save the file as an .xls object

wb

a spreadsheet

Examples

1
2
3
4
5
6
7
## Not run: 
input_cells <- c('A1', 'A2')
input_values = c(4, 9)
output_cells = c('B1', 'B2')
# ADD SAMPLE SPREADSHEET TO PACKAGE AND RUN CODE

## End(Not run)

CivilEngineerUK/interactexcel documentation built on May 27, 2019, 2:05 p.m.