R(20), Data Interface - Excel

Published: by Creative Commons Licence

package xlsx.

if we wanna load the library xlsx into R workspace, we need a Java environment. Otherwise, after run the command library("xlsx"), we will see this:

Error: package or namespace load failed for ‘xlsx’:
 .onLoad failed in loadNamespace() for 'rJava', details:
  call: fun(libname, pkgname)
  error: JAVA_HOME cannot be determined from the Registry

read

we can use input.xlsx() to read the XLSX file. like:

# Read the first worksheet in the file input.xlsx.
data <- read.xlsx("input.xlsx", sheetIndex = 1)

Wanna have a java environment? click here.

However, there is a few interesting packages without the Java dependency. like the picture followed:

picture of a hint


To tell the truth, although I have already install Java environment in my environment, it still seems doesn't work. May be I will solve the problem in the future…