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

Resolve issue #94 #96

Merged
merged 5 commits into from
Apr 26, 2024
Merged
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
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: mschart
Type: Package
Title: Chart Generation for 'Microsoft Word' and 'Microsoft PowerPoint' Documents
Version: 0.4.0
Version: 0.4.1.001
Authors@R: c(
person("David", "Gohel", role = c("aut", "cre"),
email = "[email protected]"),
Expand Down Expand Up @@ -31,6 +31,6 @@ Imports: stats, data.table,
htmltools, utils
URL: https://ardata-fr.github.io/officeverse/, https://ardata-fr.github.io/mschart/
BugReports: https://github.com/ardata-fr/mschart/issues
RoxygenNote: 7.2.2
RoxygenNote: 7.3.1
Roxygen: list(markdown = TRUE)
Suggests: tinytest, doconv
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ importFrom(cellranger,as.range)
importFrom(cellranger,cell_limits)
importFrom(cellranger,ra_ref)
importFrom(cellranger,to_string)
importFrom(data.table,":=")
importFrom(data.table,.N)
importFrom(data.table,as.data.table)
importFrom(data.table,dcast.data.table)
importFrom(data.table,rbindlist)
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# mschart 0.4.1

## Issues

* fix issue with dcast by making sure all data are preserved.

# mschart 0.4.0

## New features
Expand Down
11 changes: 4 additions & 7 deletions R/excel_series.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ transpose_data <- function(data, vars, group) {
}


#' @importFrom data.table := .N
dcast_data <- function(data, x, y, group) {
dataset <- as.data.table(data)
form_str <- sprintf("%s ~ %s", x, group)
dataset <- dataset[, c(".fake_id.") := list(seq_len(.N)), by = c(x, group)]
form_str <- sprintf("%s + .fake_id. ~ %s", x, group)
out <- dcast.data.table(
dataset,
formula = as.formula(form_str),
fun.aggregate = function(x) {
x
},
fill = NA, value.var = y
)
out$.fake_id. <- NULL
setDF(out)
out
}
Expand Down Expand Up @@ -96,9 +96,6 @@ transpose_series_bysplit <- function(x) {






#' @importFrom stats as.formula
#' @importFrom data.table as.data.table dcast.data.table setorderv setnames
shape_as_series <- function(x) {
Expand Down
2 changes: 1 addition & 1 deletion man/mschart.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading