Skip to content
Merged

4.2.9 #541

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Type: Package
Package: openxlsx
Title: Read, Write and Edit xlsx Files
Version: 4.2.8.1
Date: 2025-10-30
Version: 4.2.9
Authors@R:
c(person(given = "Philipp",
family = "Schauberger",
Expand Down Expand Up @@ -57,8 +56,11 @@ Imports:
Suggests:
curl,
formula.tools,
ggplot2,
jpeg,
knitr,
rmarkdown,
survival,
testthat
LinkingTo:
Rcpp
Expand Down Expand Up @@ -102,4 +104,4 @@ Collate:
'zzz.R'
Roxygen: list(markdown = TRUE)
LazyData: true
Config/roxygen2/version: 8.0.0
Config/roxygen2/version: 8.1.0
50 changes: 36 additions & 14 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
# Generated by roxygen2: do not edit by hand

S3method("names<-",Workbook)
S3method(all.equal,Workbook)
S3method(as.character,formula)
S3method(getNamedRegions,Workbook)
S3method(getNamedRegions,default)
S3method(names,Workbook)
S3method(openxlsxCoerce,anova)
S3method(openxlsxCoerce,aov)
S3method(openxlsxCoerce,array)
S3method(openxlsxCoerce,cox.zph)
S3method(openxlsxCoerce,coxph)
S3method(openxlsxCoerce,data.frame)
S3method(openxlsxCoerce,data.table)
S3method(openxlsxCoerce,default)
S3method(openxlsxCoerce,glm)
S3method(openxlsxCoerce,hyperlink)
S3method(openxlsxCoerce,lm)
S3method(openxlsxCoerce,matrix)
S3method(openxlsxCoerce,prcomp)
S3method(openxlsxCoerce,summary.coxph)
S3method(openxlsxCoerce,summary.prcomp)
S3method(openxlsxCoerce,survdiff)
S3method(openxlsxCoerce,table)
S3method(read.xlsx,Workbook)
S3method(read.xlsx,default)
export("activeSheet<-")
Expand Down Expand Up @@ -97,20 +115,24 @@ export(writeFormula)
import(Rcpp)
import(methods)
import(stringi)
importFrom(grDevices,bmp)
importFrom(grDevices,col2rgb)
importFrom(grDevices,colours)
importFrom(grDevices,dev.copy)
importFrom(grDevices,dev.list)
importFrom(grDevices,dev.off)
importFrom(grDevices,jpeg)
importFrom(grDevices,png)
importFrom(grDevices,rgb)
importFrom(grDevices,tiff)
importFrom(grDevices,
bmp,
col2rgb,
colours,
dev.copy,
dev.list,
dev.off,
jpeg,
png,
rgb,
tiff
)
importFrom(stats,pchisq)
importFrom(utils,download.file)
importFrom(utils,head)
importFrom(utils,menu)
importFrom(utils,unzip)
importFrom(utils,
download.file,
head,
menu,
unzip
)
importFrom(zip,zipr)
useDynLib(openxlsx, .registration=TRUE)
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
**Note:** `openxlsx` is no longer under active development. The package is maintained, and CRAN warnings will be fixed, but non-critical issues will not be addressed unless accompanied by a pull request. Packages that depend on `openxlsx` do not need to take any action, but for new developments, users are encouraged to use alternatives like `readxl`, `writexl`, or `openxlsx2`. The first two packages provide support for reading and writing `.xlsx` files. The latter package is a modern reinterpretation of `openxlsx` and provides similar functions to modify worksheets. However, it is not a drop-in replacement, so you may want to consult resources like [the update vignette](https://janmarvin.github.io/openxlsx2/articles/Update-from-openxlsx.html).

# openxlsx 4.2.9

* Fix for date detection (@sims1253, [#539](https://github.com/ycphs/openxlsx/pull/539))
* Add overwrite support to writeData() to clear stale cells when rewriting with a smaller data range (@Rong-Zh, [#536](https://github.com/ycphs/openxlsx/pull/536))

# openxlsx 4.2.8.1

* Fix for upcoming `testthat` release (@hadley, [#530](https://github.com/ycphs/openxlsx/pull/530))
* Add overwrite support to writeData() to clear stale cells when rewriting with a smaller data range ([#536](https://github.com/ycphs/openxlsx/pull/536))

# openxlsx 4.2.8

Expand Down
17 changes: 17 additions & 0 deletions R/openxlsxCoerce.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ openxlsxCoerce <- function(x, rowNames) {
}

#' @noRd
#' @export
openxlsxCoerce.default <- function(x, rowNames) {
x <- as.data.frame(x, stringsAsFactors = FALSE)
return(x)
}

#' @noRd
#' @export
openxlsxCoerce.data.frame <- function(x, rowNames) {

## cbind rownames to x
Expand All @@ -26,6 +28,7 @@ openxlsxCoerce.data.frame <- function(x, rowNames) {
}

#' @noRd
#' @export
openxlsxCoerce.data.table <- function(x, rowNames) {
x <- as.data.frame(x, stringsAsFactors = FALSE)

Expand All @@ -39,6 +42,7 @@ openxlsxCoerce.data.table <- function(x, rowNames) {
}

#' @noRd
#' @export
openxlsxCoerce.matrix <- function(x, rowNames) {
x <- as.data.frame(x, stringsAsFactors = FALSE)

Expand All @@ -51,11 +55,13 @@ openxlsxCoerce.matrix <- function(x, rowNames) {
}

#' @noRd
#' @export
openxlsxCoerce.array <- function(x, rowNames) {
stop("array in writeData : currently not supported")
}

#' @noRd
#' @export
openxlsxCoerce.aov <- function(x, rowNames) {
x <- summary(x)
x <- cbind(x[[1]])
Expand All @@ -66,6 +72,7 @@ openxlsxCoerce.aov <- function(x, rowNames) {
}

#' @noRd
#' @export
openxlsxCoerce.lm <- function(x, rowNames) {
x <- as.data.frame(summary(x)[["coefficients"]])
x <- cbind(data.frame("Variable" = rownames(x), stringsAsFactors = FALSE), x)
Expand All @@ -75,6 +82,7 @@ openxlsxCoerce.lm <- function(x, rowNames) {
}

#' @noRd
#' @export
openxlsxCoerce.anova <- function(x, rowNames) {
x <- as.data.frame(x)

Expand All @@ -87,6 +95,7 @@ openxlsxCoerce.anova <- function(x, rowNames) {
}

#' @noRd
#' @export
openxlsxCoerce.glm <- function(x, rowNames) {
x <- as.data.frame(summary(x)[["coefficients"]])
x <- cbind(data.frame("row name" = rownames(x), stringsAsFactors = FALSE), x)
Expand All @@ -96,6 +105,7 @@ openxlsxCoerce.glm <- function(x, rowNames) {
}

#' @noRd
#' @export
openxlsxCoerce.table <- function(x, rowNames) {
x <- as.data.frame(unclass(x))
x <- cbind(data.frame("Variable" = rownames(x), stringsAsFactors = FALSE), x)
Expand All @@ -105,6 +115,7 @@ openxlsxCoerce.table <- function(x, rowNames) {
}

#' @noRd
#' @export
openxlsxCoerce.prcomp <- function(x, rowNames) {
x <- as.data.frame(x$rotation)
x <- cbind(data.frame("Variable" = rownames(x), stringsAsFactors = FALSE), x)
Expand All @@ -114,6 +125,7 @@ openxlsxCoerce.prcomp <- function(x, rowNames) {
}

#' @noRd
#' @export
openxlsxCoerce.summary.prcomp <- function(x, rowNames) {
x <- as.data.frame(x$importance)
x <- cbind(data.frame("Variable" = rownames(x), stringsAsFactors = FALSE), x)
Expand All @@ -131,6 +143,7 @@ openxlsxCoerce.summary.prcomp <- function(x, rowNames) {
#' @importFrom stats pchisq
#' @keywords internal
#' @noRd
#' @export
openxlsxCoerce.survdiff <- function(x, rowNames) {


Expand Down Expand Up @@ -175,6 +188,7 @@ openxlsxCoerce.survdiff <- function(x, rowNames) {


#' @noRd
#' @export
openxlsxCoerce.coxph <- function(x, rowNames) {

## sligthly modified print.coxph
Expand Down Expand Up @@ -203,6 +217,7 @@ openxlsxCoerce.coxph <- function(x, rowNames) {


#' @noRd
#' @export
openxlsxCoerce.summary.coxph <- function(x, rowNames) {
coef <- x$coefficients
ci <- x$conf.int
Expand All @@ -223,6 +238,7 @@ openxlsxCoerce.summary.coxph <- function(x, rowNames) {
}

#' @noRd
#' @export
openxlsxCoerce.cox.zph <- function(x, rowNames) {
tmp <- as.data.frame(x$table)
x <- cbind(data.frame("row names" = rownames(tmp)), tmp)
Expand All @@ -232,6 +248,7 @@ openxlsxCoerce.cox.zph <- function(x, rowNames) {
}

#' @noRd
#' @export
openxlsxCoerce.hyperlink <- function(x, rowNames) {
## vector of hyperlinks
class(x) <- c("character", "hyperlink")
Expand Down
1 change: 1 addition & 0 deletions R/wrappers.R
Original file line number Diff line number Diff line change
Expand Up @@ -3830,6 +3830,7 @@ conditionalFormat <- function(wb, sheet, cols, rows, rule = NULL, style = NULL,
#' @param target A `Workbook` object
#' @param current A `Workbook` object
#' @param ... ignored
#' @export
all.equal.Workbook <- function(target, current, ...) {


Expand Down
4 changes: 0 additions & 4 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ CMD
Calibri
Calligra
Colour
Customizable
DL
DateTime
FFC
Expand Down Expand Up @@ -37,7 +36,6 @@ asTable
beginsWith
bgFill
bmp
bool
bottomN
changeLastModifiedBy
choosen
Expand All @@ -56,9 +54,7 @@ createStyle
createWorkbook
databar
dateFormat
datetime
datetimeFormat
datetimes
detectDates
dev
df
Expand Down
Loading