There are very [similar](https://stackoverflow.com/questions/9548630/read-gzipped-csv-directly-from-a-url-in-r) questions about this topic, but non deals with this under R quite precisely.

I have a csv.gz file and I would like to "unzip" the file and have it as ordinary \*.csv file. I suppose one would go about first reading the csv.gz file and latter via write.csv command create the csv file itself.

Here what I have tried a part of other things:

```
gz.file <- read.csv(gzfile(file.choose()), as.is = TRUE)

```

gives:

```
  head(gz.file)
        farmNo.milk.energy.vet.cows
  1     1;862533;117894;21186;121
  2     2;605764;72049;43910;80
  3     3;865658;158466;54583;95
  4     4;662331;66783;45469;87
  5     5;1003444;101714;81625;125
  6     6;923512;252408;96807;135

```

File claims to be data.frame but doesn't behave like one, what I'm missing here?

```
 class(gz.file)
 [1] "data.frame"

```

Once read into memory I would like to have it in pure csv file, so would write.csv would be the solution?

```
write.csv(gz.file, file="PATH")

```