0

Here's my code:

library(readxl)
datasets <- system.file("C:/Users/tyeg/Documents/Gamma Counter Processing/Inflammation/Study Compilation Sheet2.xlsx", package = "readxl")
read_excel(datasets)

Here's the error I get:

'' does not exist in current working directory
lebelinoz
  • 4,890
  • 10
  • 33
  • 56
GT.
  • 764
  • 1
  • 8
  • 30
  • I think you're confused about what `system.file` does. Try just handing `read_excel` the full path that you're currently giving to `system.file`. – joran Dec 08 '16 at 20:12
  • Sure. I'll try that. I was just following the format used in the documentation here: https://cran.r-project.org/web/packages/readxl/readxl.pdf – GT. Dec 08 '16 at 20:13
  • It worked! Thanks. Any idea why the documentation had different syntax? – GT. Dec 08 '16 at 20:15
  • Yeah, like I said, `system.file` is being used there to retrieve the file path for files that are contained in the package **readxl** to be used as examples. Since everyone's computers are different, `system.file` is a way to reliably return a useable file path on different computers. The documentation for `read_excel` clearly says that `path` should simply be the file path to your document. – joran Dec 08 '16 at 20:16

0 Answers0