New to RStudio. Can't upload Excel files.

I'm brand new to using Rstudio. Using it for school. I need to upload an excel file and it keeps giving me the error "Is this a valid Excel file? Unknown input format" I've downloaded the tidyverse packages and readxl. There seems to be something crucial I'm missing but I can't figure it out. I could really use the help and step by step instructions if that's possible.

Hi there, would be helpful if you could provide some code you used...
As this is a very basic question, maybe you should consider consulting some literature first? I myself started with Marcelo Perlin's book "Analyzing Financial and Economic Data with R". I found it quite helpful as it covers most topics to get started.

I've read the literature.

install.packages("devtools")
Installing package into ‘C:/Users/miran/OneDrive/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cran.microsoft.com/bin/windows/contrib/4.1/devtools_2.4.3.zip'
Content type 'application/zip' length 423453 bytes (413 KB)
downloaded 413 KB

package ‘devtools’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\miran\AppData\Local\Temp\Rtmpuol5JJ\downloaded_packages

library(readxl)
install.packages("tidyverse")
Installing package into ‘C:/Users/miran/OneDrive/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cran.microsoft.com/bin/windows/contrib/4.1/tidyverse_1.3.1.zip'
Content type 'application/zip' length 430188 bytes (420 KB)
downloaded 420 KB

package ‘tidyverse’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\miran\AppData\Local\Temp\Rtmpuol5JJ\downloaded_packages

library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in readRDS(nsInfoFilePath):
unknown input format
tidyverse_update(recursive = FALSE, repos = getOption("repos"))
Error in tidyverse_update(recursive = FALSE, repos = getOption("repos")) :
could not find function "tidyverse_update"
tidyverse_deps(recursive = FALSE, repos = getOption("repos"))
Error in tidyverse_deps(recursive = FALSE, repos = getOption("repos")) :
could not find function "tidyverse_deps"

None of this has anything (specifically) to do with importing an Excel file...

What happens if you simply do:

install.packages("readxl")

John

Yep. I already did that. Package was installed successfully. Path is fine. It just keeps telling me " Are you sure this is a valid excel file? unknown file type"

install.packages("readxl")
Error in install.packages : Updating loaded packages

Restarting R session...

install.packages("readxl")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/miran/OneDrive/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cran.microsoft.com/bin/windows/contrib/4.1/readxl_1.3.1.zip'
Content type 'application/zip' length 1717263 bytes (1.6 MB)
downloaded 1.6 MB

package ‘readxl’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\miran\AppData\Local\Temp\Rtmpieq00M\downloaded_packages

This answer on SO might be relevant for you, based on the error you got:

 Error: package or namespace load failed for ‘tidyverse’ in readRDS(nsInfoFilePath):

There are conflicting posts in this thread; is readxl installed or not?

If library(readxl) comes back with no errors, then we can move onto the problem of loading the actual XLS/XLSX file.

Test the file's format using the following:

readxl::excel_format("filename.xls")

Do ?excel_format to find out more about how to use this function...

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.