So, running 2022.07.1 - build 554. Was following along with some online 'RStudio tutorials' (which I'm hoping to use for one of my classes), when all of a sudden, various 'steps of the tutorial' no longer worked. Took me a while to figure out that imported Excel files are no longer 'standard' dataframes - they're now tibbles.
PITA -- sure, I can convert from a tibble -> dataframe, but, is there an option that would let the RStudio user simply turn off the new default behaviour - when using GUI imports for Excel files? Seriously - I'm not a fan of tidyverse, or tibbles as part of same.
I always thought a tibble is just another (an improved) presentation of a dataframe, thinking that everything that can be done on a dataframe can also be done on a tibble.
Now I am curious: What isn't working with a tibble that works with a dataframe?
Regarding your question: Not sure, but maybe you can swap to the non-tidyverse related importers, as openxlsx instead of readxl, read.csv instead read_csv...
Lots of subsetting functions that work with dataframes don't work (or, work differently) with tibbles.
And yes, I can use other tools to import .xlxs files into R from the CLI, that don't 'mess' with things by turning them into tibbles. But....in the teaching environment, I'll no longer be able to simply have student use the GUI feature in RStudio to import from Excel -> dataframe, because....it no longer does. It imports into a tibble.
Agreed, except that most non-CS students look for a 'menu option' to do basic things -- and the 'import Excel' option in RStudio is very 'tempting'. So now the lecture has to cover silly things like 'well, you could import that way, but then you'd need to convert'.
Basically, my teaching defaults are: (1) always put an Excel file in .csv first, and (2) ignore/don't use/ban tidyverse.
The rest of the analysis (data analysis, statistical tests, plots, etc.) will presumably be based on typing in code, so I don't see what difference an extra line at the start makes.
If coding is to be avoided and everything done via a GUI then R should not be used at all.
Sure, but my original question still stands -- RStudio would be 'improved' if there was a preference that allowed the user to specify what package(s) is used for importing data. The fact that it hard-defaults to tibble is Draconian. IMO, defaults should always be base R. Period.
I've got an older version of RStudio installed, so cannot check what it's like now, but in mine there is a choice between base and readr for text import and it seems to use readxl for Excel (not csv) files.
If they are forcing people down the tidyverse route by removing the base option then that is really regrettable.
Current version still allows base and readr for text import. The issue is with Excel files, and direct import for Excel files. Hence, my admonition to students that they export from Excel -> csv as a first step.
You can use import(path to your excel file including the Excel extension) from the rio package. This package it’s great for teaching, because with its import () function you can import all commonly used file formats. Rio returns by default a data frame.