This is a test version of Biostars. For the public version, visit https://www.biostars.org.
upload sc rna seq file into R

Hello everyone,

I meet a question to upload my scrna seq file to R. My data file is dge.txt.gz file.

I used code sample<- read.table("my/data/dir" , header = T,row.names = 1) to input my data, but R said:

 Error in file(file, "rt") : cannot open the connection
In addition: Warning messages:
1: In file(file, "rt") :
  'raw = FALSE' but 'my/data/dir' is not a regular file
2: In file(file, "rt") :
  cannot open file 'my/data/dir': it is a directory.

Please give me some suggestion on how to solve this problem.

Thank you very much.

r

I think the easiest way for you would be, in RStudio, to upload you file doing: File > Import Dataset > From text (base)...

Thanks for your replay. However, I analyses my data on a server, thus I cannot do file>import dataset.

1 answer

not

 read.table("my/data/dir"...

but

 read.table("path/to/your/file.csv" ....

Yes, I wrote like "read.table("path/to/your/file.csv" ....". I wrote "my/data/dir" refers to the path to my dge.txt.gz file.

but that was a directory, not a file:

cannot open file 'my/data/dir': it is a directory.

I see! Thank you so much! I understand where I got wrong. I appreciate your help!

Log in to answer this question.