我正试图在Rstudio中安装xlsx软件包,但出现了错误

我正试图在Rstudio中安装xlsx软件包,但出现了错误,r,r-xlsx,R,R Xlsx,试图在Ubuntu 14.04 LTS OS type-64位上的Rstudio中安装xlsx软件包,但安装时出错。请指导我如何解决这些错误,因为我正在尝试创建一个脚本,在该脚本中,我可以读取Excel文件,并对列数据进行一些统计 install.packages("xlsx") Installing package into ‘/home/supratech/R/x86_64-pc-linux-gnu- library/3.3’ (as ‘lib’ is unspecified) also i

试图在Ubuntu 14.04 LTS OS type-64位上的Rstudio中安装xlsx软件包,但安装时出错。请指导我如何解决这些错误,因为我正在尝试创建一个脚本,在该脚本中,我可以读取Excel文件,并对列数据进行一些统计

install.packages("xlsx")
Installing package into ‘/home/supratech/R/x86_64-pc-linux-gnu-
library/3.3’
(as ‘lib’ is unspecified)
also installing the dependencies ‘rJava’, ‘xlsxjars’

trying URL 'https://cran.rstudio.com/src/contrib/rJava_0.9-8.tar.gz'
Content type 'unknown' length 656615 bytes (641 KB)
==================================================
downloaded 641 KB

trying URL   
'https://cran.rstudio.com/src/contrib/xlsxjars_0.6.1.tar.gz'
Content type 'unknown' length 9477071 bytes (9.0 MB)
==================================================
downloaded 9.0 MB


trying URL 'https://cran.rstudio.com/src/contrib/xlsx_0.5.7.tar.gz'
Content type 'unknown' length 312839 bytes (305 KB)
==================================================
downloaded 305 KB

* installing *source* package ‘rJava’ ...
** package ‘rJava’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether time.h and sys/time.h may both be included... yes
configure: checking whether gcc -std=gnu99 supports static inline...
yes
checking whether setjmp.h is POSIX.1 compatible... yes
checking whether sigsetjmp is declared... yes
checking whether siglongjmp is declared... yes
checking Java support in R... present:
interpreter : '/usr/lib/jvm/default-java/jre/bin/java'
archiver    : '/usr/bin/jar'
compiler    : '/usr/bin/javac'
header prep.: '/usr/bin/javah'
cpp flags   : ''
java libs   : ''
configure: error: One or more Java configuration variables are not  
set.
Make sure R is configured with full Java support (including JDK). Run
R CMD javareconf
as root to add Java support to R.

If you don't have root privileges, run
R CMD javareconf -e
to set all Java-related variables and then install rJava.

ERROR: configuration failed for package ‘rJava’
* removing ‘/home/supratech/R/x86_64-pc-linux-gnu-library/3.3/rJava’
Warning in install.packages :
installation of package ‘rJava’ had non-zero exit status
ERROR: dependency ‘rJava’ is not available for package ‘xlsxjars’
* removing ‘/home/supratech/R/x86_64-pc-linux-gnu-   
library/3.3/xlsxjars’
Warning in install.packages :
installation of package ‘xlsxjars’ had non-zero exit status
ERROR: dependencies ‘rJava’, ‘xlsxjars’ are not available for package    
‘xlsx’
* removing ‘/home/supratech/R/x86_64-pc-linux-gnu-library/3.3/xlsx’
Warning in install.packages :
installation of package ‘xlsx’ had non-zero exit status

The downloaded source packages are in
  ‘/tmp/RtmpH45TY8/downloaded_packages’

在Ubuntu上安装rJava最简单的方法是从存储库安装,而不是直接从CRAN安装

sudo apt-get install r-cran-rjava

在Ubuntu上安装rJava最简单的方法是从存储库安装,而不是直接从CRAN安装

sudo apt-get install r-cran-rjava

看起来是完全相同的输出。。。当然(如果你想避免使用Java)并且可以使用更少的功能使用另一个包,比如
readxl
…看起来完全一样的输出。。。当然(如果您想避免使用Java),并且可以使用较少的功能使用另一个包,如
readxl
…谢谢。这很有效。@Mansi,保持接受答案或更新答案的习惯,以保持贡献者的积极性。我对堆栈溢出完全陌生。。谢谢:)@Mansi,我们在这里是为了进一步帮助您,这里是感谢的快速指南。这很有效。@Mansi,保持接受答案或更新答案的习惯,以保持贡献者的积极性。我对堆栈溢出完全陌生。。谢谢:)@Mansi,我们在这里是为了进一步帮助您,这里是您的快速指南