Closed leofontenelle closed 8 years ago
Thanks for your suggestions Leo. Here are my comments:
on.exit()
, I may implement it sometime in the future.if( dbc2dbf(file, out) ) stop("Could not uncompress file!")
-> you need to negate the output of dbc2dbf to treat for errors. Also, you've introduced another bug when calling stopifnot(!file.exists(input.file))
-> please note you are negating twice.stopifnot
is something like Error: !file.exists(input.file) is not TRUE
I don't want to discourage you to contribute, but please be careful with the code you submit. Also, beware of over tuning / over pruning. This code is simple enough to be readable and usable. Sometimes we try to complicate simple things and take the chance to introduce bugs like those above.
Thanks for the comments! I saw the opportunity for on.exit()
and got carried away. Sorry for not testing the code before sending the suggestions, I haven't figured out how to do it yet. (Sorry for not sleeping on the suggestions either!)
While the code seems to be running fine, I would like to provide a few suggestions of minor code improvements in read.dbc:
on.exit()
to avoid nesting code.return()
Also, in both read.dbc and dbc2dbf I used a
stopifnot()
, which might or might not suit your preferences.