Hey everyone, I'm a student of econometrics who is required to use R-studio for assignments in class. However, I started having problems with this software accepting excel files as either .xlsx or .csv files; I keep on getting "use of save versions prior to 2 is deprecated" error when I try loading an excel file as a work session (for using commands to deduce regression variables like standard errors or logarithms).
I was given an assignment that required me to use R-studio. My colleague informed me that she managed to get her answers working by loading the excel file through the load workspace in sessions tab on top.
I reported this to my professor, who provided me this link:
Quora link (posted below)
I did everything instructed on that topic and still get the same problem as before. I then approach this problem over to stackoverflow and they lock my topic because there isn't enough "details and descriptive" in that topic.
Welcome to the community. Unfortunately, they are very strict on stackoverflow and if you don't have a question setup in a specific way they will simply close it.
Lets start with the .csv read and then we will look at the other one. For the csv one you can simply do the following:
First check that the package can be loaded. If not then remove the # and run the first line. You need to change the df.csv to the name of yours. If this works great. If it doesn't work it might mean that your working directory is not the same as where the file is saved. In that instance you will need to specify the whole path and change the \ to / so it can understand it.
You will see in my code we are reading in the data and allocating it to an object called df_csv. You are able to give it any name. We assign things to objects in this way because then it is evident how they became. You can give it any name.
The excel read should work the same but you might have difficulties finding the package. So let me know if it picks up the install. If it does then the same above should work here.
To follow GreyMerchant, I also wanted to point out RStudio has a nice data loading GUI tool built into it.
You can find instructions on how to use that below. A handy part of the tool is that it'll show you the code it used to load your file.
Your second screenshot appears to show that you've successfully loaded the hamburger xlsx file.
If you're curious about the "prior to 2" error message, it's coming from load function. load is not designed to be used with csv or other spreadsheet files.
So, my response is a bit late because I really got bogged down by annoying assignments from other courses, but here I'm again.
@EconomiCurtis: No, there is a problem with importing data like that and using it. Here is an image file that show cases everything I did before the errors on my first post came to being(using the GUI):
@GreyMerchant I tried those commands, first by checking if the package is loaded, than removing the # and running the first line. The only way the excel file can load successfully is through the GUI, but doing so would not help me run the commands that are needed for my assignment (shown on the picture to EconomicCurtis)
Look again at the blue text in the console in the image you shared where hamburger object is loaded from read_excel function. That is working code, that you can repeat in future R sessions avoiding the gui import helpers.
Sidenote: the red error message relating to attempt to install.packages readr is because library names should be quoted to appear as character strings to that function. install.packages("readr")
Its not clear to me that you have had the realisation that if you did not use the GUI loading, but rather wrote that same blue text, the end result would be the same for you. So at the risk of seeming condescending, I'm writing this to underline the point. Hope you don't mind.
The base load() function is for loading R objects, not csv nor excel files. When you are using load() you are neither using readxl package, nor readr package functions.
I think you should read through this forum thread again and identify the functions that you have been recommended to use (none of which were load)
nirgrahamuk, alright thanks. I'm getting conflicting responses from my colleagues who managed to get the software working so I'm really confused about its use. This software was suppose to be taught at university labs, but isn't doable for the current semester because of covid. I have no choice but to slog through this.