title: Cannot read .xlsx file in R
body: <p>How do I read excel files with <code>.xlsx</code> extension in <a href="/questions/tagged/r" class="post-tag" title="show questions tagged &#39;r&#39;" rel="tag">r</a> programming language? I have tried installing package <a href="/questions/tagged/xlsx" class="post-tag" title="show questions tagged &#39;xlsx&#39;" rel="tag">xlsx</a> but after I run <code>library(xlsx)</code> I get - </p>
  
  <blockquote>
    <p>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
    In addition: Warning message:
    package ‘xlsx’ was built under R version 3.5.3 ". </p>
  </blockquote>
  
  <p>Further, how can I convert <code>.xlsx</code> file to <code>.csv</code> file?</p>