Re: [R] Need help to unzip files in Windows

2021-08-25 Thread Rui Barradas
Hello, Are you looking for what follows Andrew's code below to download and untar the files? read_one_gz_file <- function(x, path){ fl <- file.path(path, x) tryCatch({ read.table(zz <- gzfile(fl)) }, warning = function(w) w, error = function(e) e ) } URL <- "https://ftp.ncb

Re: [R] Need help to unzip files in Windows

2021-08-23 Thread Anas Jamshed
but the point is that where should I start from now On Tue, Aug 24, 2021 at 7:43 AM Andrew Simmons wrote: > Hello, > > > I see what you're saying that the .tar archive contains many more > compressed files, but that's not necessarily a problem. R can read directly > from a compressed file withou

Re: [R] Need help to unzip files in Windows

2021-08-23 Thread Andrew Simmons
Hello, I see what you're saying that the .tar archive contains many more compressed files, but that's not necessarily a problem. R can read directly from a compressed file without having to decompress it beforehand. I modified my code to look a little more like yours: # need to do 'path.expand'

Re: [R] Need help to unzip files in Windows

2021-08-23 Thread Anas Jamshed
sir after that I want to run: #get the list of sample names GSMnames <- t(list.files("~/Desktop/GSE162562_RAW", full.names = F)) #remove .txt from file/sample names GSMnames <- gsub(pattern = ".txt", replacement = "", GSMnames) #make a vector of the list of files to aggregate files <- list.files(

Re: [R] Need help to unzip files in Windows

2021-08-23 Thread Abby Spurdle
There are some differences in R, between Windows and Linux. You could try the 'shell' command instead. #On Windows ?shell On Tue, Aug 24, 2021 at 4:53 AM Anas Jamshed wrote: > > I have the file GSE162562_RAW. First I untar them > by untar("GSE162562_RAW.tar") > then I am running like: > system(

Re: [R] Need help to unzip files in Windows

2021-08-23 Thread Andrew Simmons
Hello, I tried downloading that file using 'utils::download.file' (which worked), but then continued to complain about "damaged archive" when trying to use 'utils::untar'. However, it seemed to work when I downloaded the archive manually. Finally, the solution I found is that you have to specify

Re: [R] Need help to unzip files in Windows

2021-08-23 Thread Anas Jamshed
I am trying this URL: " https://ftp.ncbi.nlm.nih.gov/geo/series/GSE162nnn/GSE162562/suppl/GSE162562_RAW.tar " but it is not giving me any file On Mon, Aug 23, 2021 at 11:42 PM Andrew Simmons wrote: > Hello, > > > I don't think you need to use a system command directly, I think > 'utils::untar'

Re: [R] Need help to unzip files in Windows

2021-08-23 Thread Andrew Simmons
Hello, I don't think you need to use a system command directly, I think 'utils::untar' is all you need. I tried the same thing myself, something like: URL <- "https://exiftool.org/Image-ExifTool-12.30.tar.gz"; FILE <- file.path(tempdir(), basename(URL)) utils::download.file(URL, FILE) utils::

[R] Need help to unzip files in Windows

2021-08-23 Thread Anas Jamshed
I have the file GSE162562_RAW. First I untar them by untar("GSE162562_RAW.tar") then I am running like: system("gunzip ~/Desktop/GSE162562_RAW/*.gz") This is running fine in Linux but not in windows. What changes I should make to run this command in windows as well [[alternative HTML ve