Last active
December 11, 2015 18:28
-
-
Save nassimhaddad/4641659 to your computer and use it in GitHub Desktop.
read excel sheets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' best package to read excel files is gdata | |
#' which works with both .xls and .xlsx | |
#' windows: follow instructions here: | |
#' http://cran.r-project.org/web/packages/gdata/INSTALL | |
library(gdata) | |
xlsx_file <- "myfile.xls" | |
sheet1 <- read.xls(xlsx_file, | |
sheet = "Sheet1", | |
stringsAsFactors = FALSE, | |
na.strings = "NA") | |
#' OR: | |
library(xlsx) | |
xlsx_file <- "myfile.xls" | |
text_data <- read.xlsx(xlsx_file, sheetName = "Sheet1") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment