Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unused variable #168

Merged
merged 12 commits into from
Apr 7, 2021
Merged

remove unused variable #168

merged 12 commits into from
Apr 7, 2021

Conversation

ycphs
Copy link
Owner

@ycphs ycphs commented Apr 4, 2021

No description provided.

@ycphs ycphs mentioned this pull request Apr 4, 2021
Copy link
Collaborator

@JanMarvin JanMarvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care of these!

@@ -17819,7 +17819,8 @@ Workbook$methods(

## Increment priority of conditional formatting rule
if (length((worksheets[[sheet]]$conditionalFormatting)) > 0) {
for (i in length(worksheets[[sheet]]$conditionalFormatting):1) {
for (i in order(seq_along(worksheets[[sheet]]$conditionalFormatting),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if this is intended?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh nevermind. missed the :1 while looking at the pull request this morning. I might have tried rev(), but it's fine this way

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to rev

for (i in 1:nSheets) {
# nSheets <- length(worksheets)
for (i in seq_along(worksheets)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not seq_len(nSheets)?

Copy link
Owner Author

@ycphs ycphs Apr 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it is the equivalent and nSheets is just used for this loop.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, yes. sleepy me 👍

@@ -57,9 +57,9 @@ test_that("Support non-ASCII strings not in UTF-8 encodings", {
wb <- createWorkbook(creator = non_ascii[1])
ws <- addWorksheet(wb, non_ascii[2])
writeDataTable(wb, ws, non_ascii_df, tableName = non_ascii[3])
writeData(wb, ws, non_ascii_df, xy = list("D", 1), name = non_ascii[4])
writeData(wb, ws, non_ascii_df, xy = c(4, 1), name = non_ascii[4])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these changes included? did something else change and now they bark?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed back to the initial code

@@ -168,7 +168,7 @@ test_that("Writing sheetData rows XML - iris", {
"<row r=\"151\"><c r=\"A151\" t=\"n\"><v>5.9</v></c><c r=\"B151\" t=\"n\"><v>3</v></c><c r=\"C151\" t=\"n\"><v>5.1</v></c><c r=\"D151\" t=\"n\"><v>1.8</v></c><c r=\"E151\" t=\"s\"><v>7</v></c></row>"
)

for (i in 1:length(expected_rows)) {
for (i in seq_along(expected_rows)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally would have replaced it with seq_len(length(...)). yours does look better, but I've been bitten enough not to blindly trust seq_along for anything not data.frame related.

)
priority_new,
worksheets[[sheet]]$conditionalFormatting[[i]],
fixed = TRUE)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unintended include of this chunk?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes unintended

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the changes

Repository owner deleted a comment from codecov-io Apr 6, 2021
@ycphs
Copy link
Owner Author

ycphs commented Apr 6, 2021

The failed check was code coverage

@ycphs ycphs merged commit 02781c1 into master Apr 7, 2021
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Sep 8, 2021
# development  openxlsx 4.2.4

## Fixes

* `Write.xlsx()` now successfully passes `withFilter`
  ([#151](ycphs/openxlsx#151))
* code clean up PR [#168](ycphs/openxlsx#168)
* removal of unused variables PR
  [#168](ycphs/openxlsx#168)

## New features

* adds `buildWorkbook()` to generate a `Workbook` object from a
  (named) list or a data.frame
  ([#192](ycphs/openxlsx#192),
  [#187](ycphs/openxlsx#187))
  * this is now recommended rather than the `write.xlsx(x, file) ; wb
    <- read.xlsx(file)` functionality before
  * `write.xlsx()` is now a wrapper for `wb <- buildWorkbook(x);
    saveWorkbook(x, file)`
  * parameter checking from `write.xlsx()` >> `buildWorkbook()` are
    now held off until passed to `writeData()`, `writeDataTable()`,
    etc
  * `row.names` is now deprecated for `writeData()` and
    `writeDataTable()`; please use `rowNames` instead
* `read.xlsx()` now checks for the file extension `.xlsx`; previously
  it would throw an error when the file was `.xls` or `.xlm` files

* memory allocation improvements
* global options added for `minWidth` and `maxWidth`

* `write.xlsx()` >> `buildWorkbook()` can now handle `colWidths`
  passed as either a single element or a `list()`

* Added ability to change positioning of summary columns and rows.
  * These can be set with the `summaryCol` and `summaryRow` arguments
    in `pageSetup()`.

* `activeSheet` allows to set and get the active (displayed) sheet of a worbook.

* Adds new global options for workbook formatting
  ([#165](ycphs/openxlsx#165); see
  `?op.openxlsx`)


# openxlsx 4.2.3

## New Features

* Most of functions in openxlsx now support non-ASCII arguments
  better. More specifically, we can use non-ASCII strings as names or
  contents for `createNamedRegion()`
  ([#103](ycphs/openxlsx#103)),
  `writeComment()`, `writeData()`, `writeDataTable()` and
  `writeFormula()`. In addition, openxlsx now reads comments and
  region names that contain non-ASCII strings correctly on
  Windows. Thanks to @shrektan for the PR
  [#118](ycphs/openxlsx#118).

* `setColWidths()` now supports zero-length `cols`, which is
  convinient when `cols` is dynamically provided
  [#128](ycphs/openxlsx#128). Thanks to
  @shrektan for the feature request and the PR.

## Fixes for Check issues

* Fix to pass the tests for link-time optimization type mismatches

* Fix to pass the checks of native code (C/C++) based on static code
  analysis

## Bug Fixes

* Grouping columns after setting widths no longer throws an error
  ([#100](ycphs/openxlsx#100))

* Fix inability to save workbook more than once
  ([#106](ycphs/openxlsx#106))

* Fix `loadWorkbook()` sometimes importing incorrect column attributes

# openxlsx 4.2.2

## New Features

* Added features for `conditionalFormatting` to support also 'contains
  not', 'begins with' and 'ends with'

* Added return value for `saveWorkbook()` the default value for
  `returnValue` is `FALSE`
  ([#71](ycphs/openxlsx#71))

* Added Tests for new parameter of `saveWorkbook()`

## Bug Fixes

* Solved CRAN check errors based on the change disussed in
  [PR#17277](https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17277)

# openxlsx 4.2.0

## New Features

* Added `groupColumns()`, `groupRows()`, `ungroupColumns()`, and
  `ungroupRows()` to group/ugroup columns/rows
  ([#32](ycphs/openxlsx#32))

## Bug Fixes

* Allow xml-sensitve characters in sheetnames
  ([#78](ycphs/openxlsx#78))

## Internal

* Updated roxygen2 to 7.1.1

# openxlsx 4.1.5.1

## Bug Fixes

*  fixed issue [#68](ycphs/openxlsx#68])

# openxlsx 4.1.5

## New Features

*  Add functions to get and set the creator of the xlsx file

*  add function to set the name of the user who last modified the xlsx file

## Bug Fixes

*  Fixed NEWS hyperlink

*  Fixed writing of mixed EST/EDT datetimes

* Added description for `writeFormula()` to use only english function
   names

*  Fixed validateSheet for special characters

## Internal

*  applied the tidyverse-style to the package `styler::style_pkg()`

*  include tests for `cloneWorksheet`

# openxlsx 4.1.4

## New Features

* Added `getCellRefs()` as
   function. [#7](ycphs/openxlsx#7)

*  Added parameter for customizing na.strings

## Bug Fixes

*  Use `zip::zipr()` instead of `zip::zip()`.

* Keep correct visibility option for
   loadWorkbook. [#12](ycphs/openxlsx#12])

* Add space surrounding "wrapText"
   [#17](ycphs/openxlsx#17)

* Corrected Percentage, Accounting, Comma, Currency class on column
   level


*  update to rogygen2 7.0.0

# openxlsx 4.1.3

## New Features

*  Added a `NEWS.md` file to track changes to the package.
*  Added `pkgdown` to create site.

## Bug Fixes

*  Return values for cpp changed to R_NilValue for r-devel tests

*  Added empty lines at the end of files

# openxlsx 4.1.2

*  Changed maintainer

# openxlsx 4.1.1

## New Features

* `sep.names` allows choose other separator than '.' for variable
   names with a blank inside

* Improve handling of non-region names in `getNamedRegions` and add
   related test
@JanMarvin JanMarvin deleted the lint_cleanup branch October 7, 2024 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants