-
-
Notifications
You must be signed in to change notification settings - Fork 878
Commit
NA
in first column
Previously, `diff()` would return `NA` which does not work with `==` for comparaison. closes #2207
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: knitr | ||
Type: Package | ||
Title: A General-Purpose Package for Dynamic Report Generation in R | ||
Version: 1.41.7 | ||
Version: 1.41.8 | ||
Authors@R: c( | ||
person("Yihui", "Xie", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666")), | ||
person("Abhraneel", "Sarma", role = "ctb"), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -661,7 +661,7 @@ eng_sql = function(options) { | |
|
||
# force left alignment if the first column is an incremental id column | ||
first_column = display_data[[1]] | ||
if (is.numeric(first_column) && length(first_column) > 1 && all(diff(first_column) == 1)) | ||
if (is.numeric(first_column) && length(first_column) > 1 && all(identical(diff(first_column), 1))) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
cderv
Author
Collaborator
|
||
display_data[[1]] = as.character(first_column) | ||
|
||
# wrap html output in a div so special styling can be applied | ||
|
x == 1
andidentical(x, 1)
are not equivalent (I meanx = diff(first_column)
here). First,x
can be a vector of length > 1, e.g.,c(1, 1, 1)
. Second,x
can be integer, e.g.,1L
.This has been amended in 3c87d2d.