Changelog
Source:NEWS.md
datablinder 0.1.0
First public release.
Package skeleton.
Reading and writing delimited text files (CSV/TSV) and Excel workbooks, remembering the delimiter, decimal mark, encoding, line endings, byte order mark, missing-value text and sheet names needed to write the blinded copy back in the same shape.
Column type detection, by values rather than by storage class, with every threshold a named constant in
R/detect.R.Seed handling that always puts
.Random.seedback as it found it, and one blinding function per detected type.blind_data()andblind_file(), the leak check that runs before anything is written, and theblind_summaryobject printed after every run.keep_real, the fifth option: the names of columns to copy over unblinded, with their real values, for a column that carries nothing sensitive and that code has to use as it is, such as a treatment arm or a study visit. A kept column stays lined up with its own rows and keeps its real name even underblind_names, which is why it cannot be combined withrows. Being the one way to make the package disclose real data, it is reported rather than assumed safe: the leak check excuses those columns and names them, so the verdict readsLeak check: passed, except 2 columns kept real: arm, visitinstead of a barepassed, and each kept column’s own line readsREAL VALUES KEPT, not blinded. Naming a column the data does not have is an error before anything is written.SPSS (
.sav,.zsav), Stata (.dta),.rdsand Parquet files, keeping value labels, variable labels and display formats, and the class of the data frame stored in an.rds. Parquet needs the suggestedarrowpackage. An SPSS code declared user-missing is now treated as the code it is, not as a missing value.run_app(), a Shiny app on127.0.0.1with the five options, the summary and a Copy button. The Keep real box lists the uploaded file’s columns to choose from, read from the file’s header alone so that a large file is not read twice. Then a preview of the first ten blinded rows (one sheet at a time for a workbook) and a download button. Uploads of up to 1 GB are allowed, the browser’s copy of the upload is deleted as soon as the app has its own, and that copy goes when the session ends. Also an RStudio addin, Blind a data file, that opens the app.A command line wrapper,
inst/scripts/datablinder, with the five options plus--output,--helpand--version;--keep-realtakes a comma separated list of column names. The summary goes to standard output and anything that went wrong to standard error, with an exit status of 1 if the file could not be blinded or the leak check failed.install_cli(), which puts that command where the shell can find it on macOS, Linux and Windows: it copies the script to a directory that is on thePATHwhere it can, writes the.cmdshim Windows needs, and says plainly whether the shell will find the command and what to add to thePATHif it will not. It needs nosudoand never edits a shell configuration file. It is the only function here that writes a file outliving the session, so it asks first: it prints the directory and waits fory, and any other answer writes nothing, not even the directory. Where there is nobody to ask, in a script orRscript -e, it is an error rather than a silent write to a home directory. Adirinsidetempdir()needs no permission, since the session takes it away again.A README that leads with the one promise the package makes, shows the three ways to run it, and says plainly in a Limits section what the blinded copy does not give you: no formal privacy guarantee, a structure that stays visible on purpose, no meaning in any analysis of the copy, since columns are blinded independently, and whole columns shared as they are if
keep_realnames them. It credits FakeDataR for the ideas borrowed from it.R CMD checkruns clean.Help pages that stand on their own, for anyone who never sees the README:
?datablindergives the promise, the four functions, the five options and the limits;?blind_dataand?blind_fileboth carry the list of what happens to each kind of column; and?blind_summarydescribes the summary object, what to look for in it before sharing a file, andformat()for getting its lines as a character vector.