Importing an Excel Workbook into R

June 4, 2014

(This article was first published on The Pith of Performance, and kindly contributed to R-bloggers)

usually import Excel data in CVS format A new package in CRAN facilitates reading in entire Excel workbook and selecting worksheets and cells from there. example....


# Load Excel workbook into memory
wb <- loadWorkbook("~/Desktop/R XLConnect/82scaling.xlsx", create = FALSE)

# Convert a sheet to a data frame
df <- readWorksheet(wb,
sheet = "SGI-NUMA",
startRow = 3,
endRow = 15,
startCol = which(LETTERS=="A"),
endCol = which(LETTERS=="P")


# Measured KRays.Sec RelCap Efficiency Inverse Fit Transform Trendline Parameters
#1 CPU (p) X(p) C=X(p)/X(1) C/p p/C p-1 (p/C)-1 Quadratic Coefficients
#2 1 20 1.00 1.00 1.00 0 0.00 a 5.0000E-06
#3 4 78 3.90 0.98 1.03 3 0.03 b 0.0500
#4 8 130 6.50 0.81 1.23 7 0.23 c 0.0000
# ...

To leave a comment for the author, please follow the link and comment on his blog: The Pith of Performance. offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.