Table of Contents

R - Excel (xlsx )

About

xlsx read, write, format Excel 2007 (xlsx) files

Management

Installation

install.packages("xlsx")
package ‘rJava’ successfully unpacked and MD5 sums checked
package ‘xlsxjars’ successfully unpacked and MD5 sums checked
package ‘xlsx’ successfully unpacked and MD5 sums checked

Read

read.xlsx or read.xlsxx

Return data type: A data.frame or a list, depending on the as.data.frame argument.

require(xlsx)
setwd("path/To/XlsxFile") # Set the working directory
res <- read.xlsx2("data.xlsx", sheetIndex=1, as.data.frame=TRUE, header=TRUE)  # read first sheet
head(res)

where: