Skip to content

Commit

Permalink
v 0.3.0.9000
Browse files Browse the repository at this point in the history
  • Loading branch information
BriceNocenti committed Mar 17, 2024
1 parent 76b2b3c commit fee9188
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 39 deletions.
3 changes: 0 additions & 3 deletions CRAN-SUBMISSION

This file was deleted.

2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ggfacto
Title: Graphs for Correspondence Analysis
Version: 0.3.0
Version: 0.3.0.9000
Authors@R:
person(given = "Brice",
family = "Nocenti",
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# ggfacto (development version)

## Bug correction
* `HCPC_tab()` was not working well with numeric variables.


# ggfacto 0.3.0

Expand Down
32 changes: 20 additions & 12 deletions R/geometrical_data_analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -5961,14 +5961,17 @@ HCPC_tab <- function(data, row_vars = character(), clust, wt,
pct = dplyr::if_else(pct == "row", "col", "row"),
wt = !!wt,
na = "drop", cleannames = TRUE, color = color,
levels = first_lvs) |>
levels = first_lvs,
...) |>
dplyr::rename_with(~ dplyr::if_else(stringr::str_detect(., "Total_", ), "Total", .)) |>
dplyr::relocate(.data$Total, .after = tidyselect::last_col()) |>
dplyr::mutate(
Total = dplyr::mutate(.data$Total,
wn = dplyr::if_else(is.na(.data$wn), as.double(.data$n), .data$wn)),
Total = vctrs::`field<-`(.data$Total, "pct",
vctrs::field(.data$Total, "wn") /
dplyr::last(vctrs::field(.data$Total, "wn")))
dplyr::last(vctrs::field(.data$Total, "wn"))) |>
tabxplor::set_col_var("Total")
)

col_var <- tabxplor::get_col_var(cah_actives_tab)[tabxplor::get_col_var(cah_actives_tab) != ""]
Expand All @@ -5986,17 +5989,11 @@ HCPC_tab <- function(data, row_vars = character(), clust, wt,
dplyr::filter(!stringr::str_detect(.data$lvs, "Remove levels")) |>
dplyr::mutate(
lvs = forcats::fct_recode(.data$lvs, !!!purrr::set_names("Total", row_tot)),
lvs = forcats::fct_relabel(.data$lvs,
~ stringr::str_replace_all(., " ", unbrk))
)

cah_actives_tab <- cah_actives_tab |>
dplyr::mutate(dplyr::across(
where(tabxplor::is_fmt), ~ dplyr::if_else(.$display == "mean",
true = dplyr::mutate(., diff = 0) |>
tabxplor::as_totrow(),
false = .)
))
## not a good idea : unbreakable spaces should be used at the end, in tab_kable()
# lvs = forcats::fct_relabel(.data$lvs,
# ~ stringr::str_replace_all(., " ", unbrk))
)

n_rows <- dplyr::filter(cah_actives_tab, tabxplor::is_totrow(cah_actives_tab)) |>
dplyr::mutate(
Expand All @@ -6008,6 +6005,17 @@ HCPC_tab <- function(data, row_vars = character(), clust, wt,
cah_actives_tab <- dplyr::bind_rows(cah_actives_tab, n_rows) |>
dplyr::group_by(.data$variables)


cah_actives_tab <- cah_actives_tab |>
dplyr::mutate(dplyr::across(
where(tabxplor::is_fmt), ~ dplyr::if_else(.$display == "mean",
true = dplyr::mutate(., diff = 0, digits = 2L) |>
tabxplor::as_totrow(),
false = .)
))



cah_actives_tab
}

Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ ggca(res.ca,

## Personnalize plots

Step-by-step functions can be used to create a database with all the necessary data, modify it, then use it to draw the plot :
Step-by-step functions can be used to create a database with all the necessary data, modify it, then use it to draw the plot:
``` {r, fig.width = 6, fig.height = 6, results = "hide", message = FALSE}
library(dplyr)
library(ggplot2)
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,11 @@ ggca(res.ca,
## Personnalize plots

Step-by-step functions can be used to create a database with all the
necessary data, modify it, then use it to draw the plot :
necessary data, modify it, then use it to draw the plot:

``` r
library(dplyr)
#> Warning: package 'dplyr' was built under R version 4.3.2
library(ggplot2)
#> Warning: package 'ggplot2' was built under R version 4.3.2

plot_data <- ggmca_data(res.mca, tea, sup_vars = "SPC")

Expand Down
26 changes: 7 additions & 19 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
## ggfacto new version 0.2.3 : first submission
## ggfacto new version 0.3.0 : first submission

ggfacto wasn't on CRAN since september 2022, because a dependancy also maintained by me,
tabxplor, was not anymore. I will now assure they both stay on CRAN in the future.


## Test environments
Expand All @@ -14,31 +12,21 @@ ggfacto wasn't on CRAN since september 2022, because a dependancy also maintaine
- Ubuntu Linux 22.04.3 LTS, R-release
- Ubuntu Linux 22.04.3 LTS, R-oldrel-1

* https://builder.r-hub.io :
- Windows Server 2022, R-devel, 64 bit
https://builder.r-hub.io/status/ggfacto_0.2.3.tar.gz-796a7101a9db42f59630de9b3e278f49
- Ubuntu Linux 20.04.1 LTS, R-release, GCC
https://builder.r-hub.io/status/ggfacto_0.2.3.tar.gz-def6afe088a6445ca2b5ef806a8ba52d
- Fedora Linux, R-devel, clang, gfortran
https://builder.r-hub.io/status/ggfacto_0.2.3.tar.gz-5149876d6b3742a385b0d4f4dbe6e398

* https://win-builder.r-project.org/uA4df9irRZ02 :
* https://win-builder.r-project.org/Ys22fzQBwi4F :
- Windows x86_64-w64-mingw32 (64-bit), R-devel

## R CMD check results
* local Windows 10:
No ERRORs, no WARNINGs, no NOTEs.

* github Actions :
No ERRORs, no WARNINGs, no NOTEs.

* https://builder.r-hub.io :
No ERRORs, no WARNINGs, 1 NOTE :
New submission/Package was archived on CRAN.
No ERRORs, no WARNINGs, no NOTEs except on :

- Ubuntu Linux 22.04.3 LTS, R-oldrel-1 :
could not install dependency `FactoMineR::`

* https://win-builder.r-project.org :
No ERRORs, no WARNINGs, 1 NOTE :
New submission/Package was archived on CRAN.
No ERRORs, no WARNINGs, no NOTE.


## Downstream dependencies
Expand Down
Binary file modified man/figures/README-unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-7-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fee9188

Please sign in to comment.