0

This is my first time to use R on a cloud server. I've downloaded the data to my online working directory. These are some details about my working directory:

getwd()
[1] "/home/fategh"

list.files()
[1] "nearline"        "projects"        "R"               "rawdata.xlsx.gz"
[5] "scratch"

Now, when I try to read the data, I get the following error:

data=read.xlsx((gzfile("rawdata.xlsx.gz")))
Error in file(description = xlsxFile) : invalid 'description' argument

data=read.xlsx((gzfile("home/fategh/rawdata.xlsx.gz")))
Error in file(description = xlsxFile) : invalid 'description' argument

I tried whatever path I could think of:

 > data=read.xlsx((gzfile(file.choose())))
 Enter file name: rawdata
 Error in file(description = xlsxFile) : invalid 'description' argument

 > data=read.xlsx((gzfile(file.choose())))
 Enter file name: rawdata.xlsx
 Error in file(description = xlsxFile) : invalid 'description' argument

 > data=read.xlsx((gzfile(file.choose())))
 Enter file name: rawdata.xlsx.gz
 Error in file(description = xlsxFile) : invalid 'description' argument

I don't know what to do about it. It's my first time working on a cloud shell.

Thank you.

fategh
  • 3
  • 2
  • Maybe you find this discussion helpful. https://stackoverflow.com/questions/5764499/decompress-gz-file-using-r/30144127 – SBFin Jun 06 '20 at 19:34
  • Oh it seems you're right. The problem sounds to be the gz file. I now imported an xlsx file with no problem. Let me see if I can figure it out. Thank you – fategh Jun 06 '20 at 19:48

0 Answers0