Decompress gz file using R

后端 未结 5 1191
逝去的感伤
逝去的感伤 2020-11-27 04:52

I have used ?unzip in the past to get at contents of a zipped file using R. This time around, I am having a hard time extracting the files from a .gz file whic

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-27 05:09

    To un-gz a file in R you can do

    library(R.utils)
    gunzip("file.gz", remove=FALSE)
    

    or

    gunzip("file.gz")
    

    But then you get the default (remove=TRUE) behavior in which the input file is removed after that the output file is fully created and closed.

提交回复
热议问题