How to read data from an Excel .xlsx file in R

To read directly from a .xlsx in the same directory as your R script:

> data <- read.xlsx(“yourdata.xlsx”)

… or …

To read from a workspace directory containing a .xlsx file:

> wdir = “C:/workspace/yourdirectory”
> data <- read.xlsx(paste(wdir, “yoursubdirectory”, “yourdata.xlsx”, sep=“/”))

… or …

To read from the second sheet of a .xlsx workbook:

> wdir = “C:/workspace/yourdirectory”
> data <- read.xlsx(paste(wdir, “yoursubdirectory”, “yourdata.xlsx”, sep=“/”), sheet = 2)

 
0
Kudos
 
0
Kudos

Now read this

How to display and flush the DNS Resolver Cache on Windows

The DNS Resolver Cache is a temporary storage cache for DNS lookups on your local machine that allows for efficient resolution of recently accessed URLs to IP addresses. To display the DNS Resolver Cache in Windows enter the following... Continue →