Read Excel File in R (Example) | xlsx, xls, read_excel, readxl, & openxlsx | Multiple Files & Sheets

Поделиться
HTML-код
  • Опубликовано: 21 авг 2024

Комментарии • 10

  • @douglaspage7311
    @douglaspage7311 2 года назад +3

    This is a great video on a pretty confusing (and ever-changing) topic.
    I would like to add that I personally use readxl::read_excel to bring files in because I like tibbles, and openxlsx::write.xlsx to write them out. The 'xlsx' package requires Java and has been a pain to deal with across different computers, whereas the other two packages don't. Also, 'readxl' has xls and xlsx specific functions in the read_*, but read_excel automatically checks the file extension.

    • @StatisticsGlobe
      @StatisticsGlobe  2 года назад +1

      Thank you very much for the kind feedback Douglas, glad you like the video! :) Also, thanks a lot for sharing your thoughts on the different packages. Personally, I prefer to work with data frames, this is definitely a matter of taste, though. Regards, Joachim

  • @haraldurkarlsson1147
    @haraldurkarlsson1147 2 года назад +1

    I agree with previous message. I get a ton of error messages with write.xlsx (and actually just trying to load in the library itself).

    • @StatisticsGlobe
      @StatisticsGlobe  2 года назад

      Hey Haraldur, the xlsx package can sometimes lead to problems due to JAVA (have a look here: statisticsglobe.com/r-error-java-home-cannot-be-determined-from-the-registry). Once this is fixed, it should work fine. However, the other packages are definitely good alternatives as well!

  • @smartinssmart
    @smartinssmart 2 года назад +1

    Thanks. 👌

    • @StatisticsGlobe
      @StatisticsGlobe  2 года назад

      You are very welcome Samir, glad you like it! :)

  • @haraldurkarlsson1147
    @haraldurkarlsson1147 2 года назад +1

    Also when I am reading in Excel files I simply save them as csv and then read them into R. Gives me fewer head aches.

    • @StatisticsGlobe
      @StatisticsGlobe  2 года назад

      I agree, working with CSVs is definitely the preferable choice. Due to non-R-related reasons, you sometimes may have to work with xlsx files, though. So I think it's good to have this in your repertoire.

  • @joseoscardelgadobautista2105
    @joseoscardelgadobautista2105 Год назад +1

    Yes, but what happens with read.xlsx2() and write.xlsx2()? Do you have any examples? in specific of Java problem

    • @cansustatisticsglobe
      @cansustatisticsglobe Год назад

      Hello Jose,
      If you encounter some potential Java-related issues, I advise you to use the functions read.xlsx and write.xlsx of the openxlsx package.
      Best,
      Cansu