简体   繁体   中英

R Commander import Excel file

Am using R Commander and trying to import a data set in Excel on a pc running Windows. Commands: Data > Import Data > from Excel file. When I do so I get the following R error message:

Loading required package: splines Loading required package: RcmdrMisc Loading required package: car Loading required package: carData Loading required package: sandwich Loading required package: effects lattice theme set by effectsTheme() See ?effectsTheme for details. Rcmdr Version 2.5-1 Attaching package: 'Rcmdr' The following object is masked from 'package:car': Confint Error in xlsx_sheets(path) : Evaluation error: 'exdir' does not exist.

Don't think it's a problem with Excel file. Have installed R Commander three times and encountered problem consistently. Doesn't work in csv format either. Mystery given I have RC on another pc and am not having this problem with same Excel file. What is the problem and how can I fix it? Thanks, RB

Try using the package readxl from the tidyverse to load your file. It's tried and true and easy to use.

First install the package from CRAN by running: install.packages("readxl")

Then import the library: library(readxl)


And finally read your excel file into an environment variable

my_spreadsheet <- read_excel("my_excel_file.xlsx")


This should work for both .xlsx files and .xls files

For more information see https://readxl.tidyverse.org/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM