Skip to content

Commit

Permalink
fix cran submission comments
Browse files Browse the repository at this point in the history
  • Loading branch information
danicat committed May 7, 2024
1 parent 7fcb63c commit e12f910
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 57 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Makefile
^revdep$
^CRAN-SUBMISSION$
^\.github$
scripts
4 changes: 2 additions & 2 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 1.0.7
Date: 2024-05-07 06:05:28 UTC
SHA: f062d4ad740054e18de560f9506a738c59133fb7
Date: 2024-05-07 07:10:45 UTC
SHA: 7fcb63ca386a7a3ee8ba00ae21cd76630c4224cf
6 changes: 5 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ Depends:
R (>= 3.3.0)
Imports:
foreign
Authors@R: person("Daniela", "Petruzalek", email = "[email protected]", role = c("aut", "cre", "cph"))
Authors@R: c(
person("Daniela", "Petruzalek", email = "[email protected]", role = c("aut", "cre", "cph")),
person("Mark", "Adler", email = "[email protected]", role = c("cph", "ctb")),
person("Pablo", "Marcondes Fonseca", email = "[email protected]", role = c("cph", "ctb"))
)
Maintainer: Daniela Petruzalek <[email protected]>
URL: https://github.com/danicat/read.dbc
BugReports: https://github.com/danicat/read.dbc/issues
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,19 @@ cran: clean document check revdep # prepare the package for CRAN release
@echo New version is ready for publishing.
@echo
@echo Please check that the following tasks are completed before submitting to CRAN:
@echo - Update NEWS.md with changelog
@echo - Update inst/CHANGELOG.md
@echo - Update NEWS.md
@echo - Update cran-comments.md
@echo
@echo After the tasks above are completed, run the following command on the terminal to submit to CRAN:
@echo
@echo Rscript -e '"'devtools::submit_cran"()"'"'
@echo
@echo Don"'"t forget to push the updated files to GitHub and tag the release as a release candidate. For example:
@echo After submitting, create a commit with the updated CRAN-SUBMISSION file and tag it as a release candidate:
@echo
@echo git tag 1.0.7-rc1 # create release candidate tag
@echo git push --tags # publish remote tag
@echo
@echo Once a submission is approved, create the corresponding release tag for the latest commit.
@echo
@echo
@echo
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

* Removed broken links
* Improved error handling in blast.c to prevent runtime errors (fixes gcc-UBSAN)
* Update DESCRIPTION with collaborators
* Documentation edits for conciseness
* Overall doc improvements
29 changes: 15 additions & 14 deletions R/dbc2dbf.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

#' Decompress a DBC (compressed DBF) file
#' Decompress a DBC file
#'
#' This function allows you decompress a DBC file.
#' Please note that this is the file format used by the Brazilian Ministry of Health (DATASUS), and it is not related to the FoxPro or CANdb DBC file formats.
#'
#' This function allows you decompress a DBC file into its DBF counterpart. Please note that this is the file format used by the Brazilian Ministry of Health (DATASUS), and it is not related to the FoxPro or CANdb DBC file formats.
#' @param input.file The name of the DBC file (including extension)
#' @param output.file The output file name (including extension)
#' @return Return TRUE if succeded, FALSE otherwise.
#' @return Return TRUE if succeed, FALSE otherwise.
#' @details
#' DBC is the extension for compressed DBF files (from the 'XBASE' family of databases). This is a proprietary file format used by the brazilian government to make available public healthcare datasets (by it's agency called DATASUS).
#'
#' It uses internally the PKWare's Data Compression Library (DCL) "implode" compression algorithm. When decompressed, it becomes a regular DBF file.
#' DBC is the extension for compressed DBF files (from the 'XBASE' family of databases).
#' This is a proprietary file format used by the Brazilian government to publish public healthcare data.
#' When decompressed, it becomes a regular DBF file.
#' @source
#' The internal C code for \code{dbc2dbf} is based on \code{blast} decompressor and \code{blast-dbf} (see \emph{References}).
#' @keywords dbc dbf
Expand All @@ -33,22 +35,21 @@
#' @seealso \code{\link{read.dbc}}
#' @examples
#' # Input file name
#' in.f <- system.file("files/sids.dbc", package = "read.dbc")
#' input <- system.file("files/sids.dbc", package = "read.dbc")
#'
#' # Output file name
#' out.f <- tempfile(fileext = ".dbc")
#' output <- tempfile(fileext = ".dbc")
#'
#' # The call return logi = TRUE on success
#' if( dbc2dbf(input.file = in.f, output.file = out.f) ) {
#' # The call returns TRUE on success
#' if( dbc2dbf(input.file = input, output.file = output) ) {
#' print("File decompressed!")
#' file.remove(out.f) # clean up example, don't do in real life :)
#' # do things with the file
#' }
#'
#' @references
#' The PKWare ZIP file format documentation (contains the "implode" algorithm specification) available at \url{https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT}.
#' file.remove(output) # clean up example, don't do in real life :)
#'
#' @references
#' \code{blast} source code in C: \url{https://github.com/madler/zlib/tree/master/contrib/blast}
#'
#' \code{blast-dbf}, DBC to DBF command-line decompression tool: \url{https://github.com/eaglebh/blast-dbf}
#'
dbc2dbf <- function(input.file, output.file) {
Expand Down
32 changes: 11 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ License: AGPLv3

## Introduction

`read.dbc` is a R package to enable importing data from `DBC` (compressed `DBF`) files into data frames. Please note that this is the file format used by the Brazilian Ministry of Health (DATASUS), and it is not related to the Microsoft FoxPro or CANdb DBC file formats.
`read.dbc` is a R package to enable importing data from `DBC` (compressed `DBF`) files into data frames. Please note that this is the file format used by DATASUS and it is not related to Microsoft FoxPro or CANdb DBC file formats.

DATASUS is the name of the Department of Informatics of Brazilian Health System. It is the agency resposible for publishing Brazilian public healthcare data. Besides DATASUS, the Brazilian National Agency for Supplementary Health (ANS) also uses this file format for its public data.
DATASUS is the name of the Department of Informatics of Brazil's Healthcare System (Sistema Unico de Saúde - SUS). They are responsible for publishing Brazilian public healthcare data. Besides DATASUS, the Brazilian National Agency for Supplementary Health (ANS) also uses this file format for its public data.

This code was tested using files from both DATASUS and ANS to ensure compliance with the format, and hence ensure its usability by researchers.

This project is based on the work of [Mark Adler](https://github.com/madler/zlib/tree/master/contrib/blast) (blast) and [Pablo Fonseca](https://github.com/eaglebh/blast-dbf) (blast-dbf).

As a final note, neither this project, nor its author, is related in any way to the Brazilian government.
Neither this project, nor its author, is related in any way to the Brazilian government.

## Changelog

Expand Down Expand Up @@ -84,27 +84,17 @@ If you have any questions, please contact me at [[email protected]](m

### Mac OS X

Install Xcode
Install R: https://cran.r-project.org/bin/macosx/
Install Rstudio: https://posit.co/download/rstudio-desktop/

Open Rstudio and run on the console:
```
install.packages("devtools")
install.packages("roxygen2")
```

To check the package is ok run:

```
devtools::check()
```

The `Makefile` also contains a few helper methods.
Setup:
- Install Xcode
- Install R: https://cran.r-project.org/bin/macosx/
- Install Rstudio: https://posit.co/download/rstudio-desktop/
- Run `make setup` to install R dependencies
- Run `make check` to verify the package

You can also run `make help` to see a list of available commands.

## Submitting to CRAN

First make sure all the checks are passing by running `make cran`.

Once ready, use `devtools::submit_cran()`.
Once ready, use `devtools::submit_cran()`. This needs to run from RStudio or the R interpreter itself as the tool doesn't allow non-interactive runs.
7 changes: 5 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
## Release information

- Remove broken links from documentation
- Improve error handling in blast.c to prevent runtime errors (fixes gcc-UBSAN issue)
* Removed broken links
* Improved error handling in blast.c to prevent runtime errors (fixes gcc-UBSAN)
* Update DESCRIPTION with collaborators
* Documentation edits for conciseness
* Overall doc improvements

## R CMD check results

Expand Down
8 changes: 8 additions & 0 deletions inst/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## CHANGELOG.md

### Version 1.0.7

* Removed broken links
* Improved error handling in blast.c to prevent runtime errors (fixes gcc-UBSAN)
* Update DESCRIPTION with collaborators
* Documentation edits for conciseness
* Overall doc improvements

### Version 1.0.5
- Fixed BUG that left files open on error (Issue #4)

Expand Down
28 changes: 14 additions & 14 deletions man/dbc2dbf.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.

0 comments on commit e12f910

Please sign in to comment.