Importing excel vs Import dataset

  1. The commands in my script in R studio includes importing an excel file. I use the read_excel("pathname/filename").

  2. Every time I run the script freshly, I get the error ""Error in plot(Easting$Easting, Easting$Jan, type = "n", main = "Rainfall vs Easting", : object 'Easting' not found"" in the console, also I cannot see the Excel file in the workspace, although the table from excel do appear in the console window. Therefore I tried to import it manually, and then when I rerun the code, the scripts runs perfectly.

  3. I have tried using only the read_excel code only in the script as a test to know whether there is a problem with my plot code, but still same results, the workspace is empty but the table is displayed in console.

  4. I have even checked my code for read_excel to be exactly the same as that produce in the console window when manually importing the excel file.

Why does the excel file not appear in the workspace upon using the code read_excel, it is the code for importing excel file, right?

read_excel() doesn't import a file, it reads its content but you have to explicitly assign it to a variable in memory if you want the content to appear in your working environment. Something like this

some_name <- read_excel("pathname/filename")
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.