While the solution proposed in the links above works it depends on using Excel's Import Wizard and generally assumes that the files in question are simple tab- or comma-delimited files. However, I would, in fact, like to make use of the capabilities of the openxlsx R package, which allows me to generate fairly complex spreadsheet collections, which is often preferable to dumping an entire folder of individual csv/txt files on a collaborator. Does anyone know how to specify the column type when using the
This is the command that I typically use to turn a list of data.frames into a collection of spreadsheets (the names of the data.frames within the list will become the names of the individual sheets in the resulting xslx file.
list_of_data_frames <- list( first_sheet = data.frame(gene = c("a","b","c"), b = 4:6), second = data.frame(X = "a", Y = 5)) openxlsx::write.xlsx(list_of_data_frames, file = "filename.xlsx", rowNames = TRUE)