Helper function for compressing to an RDS file

.compress_resource(resource, file)

## Arguments

resource the resource to write to file the name of the file (without extension)

## Value

the extension of the file