Write Data Into Excel Using R Last Updated : 13 Jun, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article, we will discuss how to write data into excel using R Programming Language. To write data into excel, we must leverage a package called xlsx in R. The excel package is a java based language that is powerful to read, write and update data from and to excel files. Syntax: write.xlsx(data, file, sheetName, col.names, row.names, append) Parameters: data - the dataframe to be written to excel filefile - the output path in which the excel file has to be storedsheetName - desired name for the sheetrow.names, col.names - (bool) if true the row and column names are copied to the excel fileappend - if True data will be appended to the existing excel file Let us use the inbuilt iris dataset and store the existing dataset in the excel file with the name iris.xlsx and sheet name iris_data. R install.packages("xlsx") library("xlsx") # Add a existing iris data set write.xlsx(iris, file = "iris.xlsx", sheetName="iris_data") Output: Output Now let us use the same file and use the append parameter to append another dataset in a separate sheet. For this purpose, let us use another inbuilt dataset called mtcars and append it to the existing file as shown in the below code. R write.xlsx(mtcars, file = "iris.xlsx", sheetName="mtcars_data", append=TRUE) Output: Output Comment More infoAdvertise with us Next Article Combine Multiple Excel Worksheets into Single Dataframe in R J jssuriyakumar Follow Improve Article Tags : R Language R-Excel Similar Reads How to plot excel data in R? Plotting graph in R using an excel file, we need an excel file with two-column in it, the values in the first column will be considered as the points at the x-axis and the values in the second column will be considered as the points at the y-axis. In this article, we will be discussing the approach 2 min read Display NA values in excel when using WriteXLS in R The term NA refers to "No Value is Available". The NA values in an Excel file are the cells that are left empty( there is no data). In R Programming, the data in the excel files are manipulated using the xlsx package. The Null (NA) values present in an excel file are displayed by initializing the a 3 min read How to Write Data to Excel Spreadsheets in MATLAB? MATLAB provides options to write a table, array, or matrix to Microsoft Excel spreadsheets. The function available to do so is the writetable () function. The general syntax for this function is: Syntax: writetable(<data>, <filename>, <optional_values>) Now, in the following sectio 3 min read Combine Multiple Excel Worksheets into Single Dataframe in R In this article, we will discuss how to combine multiple excel worksheets into a single dataframe in R Programming Language. The below XLSX file "gfg.xlsx" has been used for all the different approaches. Method 1: Using readxl package The inbuilt setwd() method is used to set the working directory 4 min read Write DataFrame to SPSS .sav File in R In this article, we are going to see how to write Dataframe to SPSS .sav File in R Programming language. The SPSS Statistics File Format is a proprietary binary format, developed and maintained as the native format for the SPSS statistical software application. To write a data frame in SPSS format i 1 min read How to create and write to a txt file using VBA This VBA Program reads an Excel Range (Sales Data) and writes to a Text file (Sales.txt). This helps in faster copying of data to a text file as VBA coding enables automated copying. Let us learn how to do it in a few easy steps: Excel VBA Write Text FileIn the realm of Excel VBA, the power to inter 5 min read Like