Say something when a formula string is written as text - #147
Merged
Conversation
A cell column has no column-wide "these are all formulas", so
df[i, j] <- "=SUM(A1:A2)"
writes those characters. That is the documented rule and it stays, but it is a
quiet way to lose every formula on a sheet: run unpatched against this writexl,
BioMonTools produces a workbook whose NOTES sheet has 0 formula cells and 20
inert HYPERLINK strings, and nothing -- not R, not R CMD check, not CRAN's
reverse-dependency run -- says a word. The file opens, so the check passes.
The assignment now warns and names the spelling that works. Nothing about what
gets written changes.
Scoped to assignment, where the ambiguity is. Measured:
d[i, j] <- "=SUM(A1)" warns
d[i, j] <- "plain text" silent
d[i, j] <- 99 silent
d[i, j] <- NA silent
d[i, j] <- xl_formula("=SUM(A1)") silent
xl_cell_general(value = "=SUM(A1)") silent
The last is deliberate: constructing a text cell that looks like a formula is
documented behaviour, and it is not the assignment path's business to
second-guess a constructor.
Unpatched BioMonTools now raises 50-odd warnings where it raised none. It is
still worth patching -- the warning tells you the formulas are gone, it does not
put them back.
billdenney
added a commit
that referenced
this pull request
Aug 5, 2026
Brings in the warning when a formula string is assigned into a cell column and written as text (#147), which the Breaking changes entry describes.
billdenney
added a commit
that referenced
this pull request
Aug 5, 2026
#147 added the warning; the Breaking changes entry described the behaviour without it. The character count was wrong too -- "=SUM(A1:A2)" is eleven, not eight.
billdenney
added a commit
that referenced
this pull request
Aug 5, 2026
* Prepare 2.0.0 Version 1.5.4.9000 -> 2.0.0 in DESCRIPTION, in the NEWS heading, and in the README line recording what the benchmark was measured on. The major number is not decoration. Four changes in this cycle alter what an existing script writes -- POSIXct time zones, Date before 1900-03-01, columns of an unrepresentable type now erroring rather than warning, and sheet-name repair truncating at a genuine 31 characters -- plus the xl_hyperlink(name =) deprecation. They were scattered through New features and Bug fixes, where a reader upgrading would have had to find them; NEWS now opens with a Breaking changes section that collects them, and the entries are removed from the sections below rather than repeated. cran-comments.md records the maintainer change from Jeroen Ooms to Bill Denney, why the version is 2.0.0, the environments checked, and the reverse-dependency result. It was already in .Rbuildignore, so it does not reach the tarball. R CMD check --as-cran, which is what a release wants rather than a plain check, turned up two scratch .rds files a revdep helper script had left at top level. Removed, and .gitignore now covers them alongside the lintr one. * As submitted to CRAN * Note the formula-column change, and drop the stale submission record The cell-vector rewrite that just landed on master removes the error BioMonTools hit, but not the reason it was writing formulas in the first place: a cell column carries no column-wide "these are all formulas", so a row assignment of a string writes a string. That is a real difference from 1.5.4, where xl_formula() returned a classed character vector and the class survived the assignment, so it belongs with the other breaking changes rather than in a note about internals. CRAN-SUBMISSION recorded the tarball built from 67fa54b, which the merge has now superseded. Leaving it would have it describe a commit that is no longer what 2.0.0 is. Its .Rbuildignore entry stays, since the next submission writes the file again. * Say that the formula-as-text assignment warns #147 added the warning; the Breaking changes entry described the behaviour without it. The character count was wrong too -- "=SUM(A1:A2)" is eleven, not eight. * Rewrite cran-comments as a resubmission The previous text told CRAN that all 135 reverse dependencies had been checked against this version with no change in result. Their pretest found otherwise, and the run behind that sentence predates both changes made since, so the claim was no longer true of these sources. It now says what was actually done: the full run, when it was made and what it therefore does not cover, and the individual re-check of the package the pretest flagged. The two changes that address the failure are described, along with BioMonTools 1.3.2 having adopted the working spelling upstream. The formula-as-text change is added to the list justifying the major version. It was missing, which is how it reached a reverse dependency unannounced. * Record that the maintainer change is already confirmed Jeroen Ooms emailed CRAN during the previous submission and CRAN acknowledged it, so the resubmission does not leave that outstanding. * Simplify comments * As submitted to CRAN * On CRAN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A cell column has no column-wide "these are all formulas", so
df[i, j] <- "=SUM(A1:A2)"
writes those characters. That is the documented rule and it stays, but it is a quiet way to lose every formula on a sheet: run unpatched against this writexl, BioMonTools produces a workbook whose NOTES sheet has 0 formula cells and 20 inert HYPERLINK strings, and nothing -- not R, not R CMD check, not CRAN's reverse-dependency run -- says a word. The file opens, so the check passes.
The assignment now warns and names the spelling that works. Nothing about what gets written changes.
Scoped to assignment, where the ambiguity is. Measured:
d[i, j] <- "=SUM(A1)" warns
d[i, j] <- "plain text" silent
d[i, j] <- 99 silent
d[i, j] <- NA silent
d[i, j] <- xl_formula("=SUM(A1)") silent
xl_cell_general(value = "=SUM(A1)") silent
The last is deliberate: constructing a text cell that looks like a formula is documented behaviour, and it is not the assignment path's business to second-guess a constructor.
Unpatched BioMonTools now raises 50-odd warnings where it raised none. It is still worth patching -- the warning tells you the formulas are gone, it does not put them back.