Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cfa89d4
reaplce RSE by sigma
GuyliannEngels Jun 21, 2024
580fe1f
adding lm_() function which is similar to lm()
GuyliannEngels Aug 9, 2024
e7602a9
Revision of internal code with creation of new internal functions. Us…
GuyliannEngels Jul 9, 2025
bfef246
use poedit for the translations
GuyliannEngels Jul 14, 2025
a41d496
To enhance code readability, group multiple importFrom directives fro…
GuyliannEngels Jul 14, 2025
106f25e
Replace .extract_infos() with .extract_infos_lm() and removal of unne…
GuyliannEngels Jul 14, 2025
a13b0fa
Add several tests for the .extract_infos_lm() function
GuyliannEngels Jul 14, 2025
081af78
update format
GuyliannEngels Jul 16, 2025
aebab64
update translation with poedit
GuyliannEngels Jul 16, 2025
8c6e431
new version for nls object and progress on make_translation
GuyliannEngels Jul 16, 2025
8ddb148
Add experimentalfunction lm_()
GuyliannEngels Jul 18, 2025
6e4f3f4
better documentation and exemple
GuyliannEngels Jul 18, 2025
c801e96
first step to refactor tabularise_*** for anova object
GuyliannEngels Jul 18, 2025
5d66aea
Complete NEWS and TODO files to clarify completed tasks and remaining…
GuyliannEngels Jul 18, 2025
74b7abb
Refactor tabularise_* to support both anova and aov objects
GuyliannEngels Aug 17, 2025
365cc1f
Improved examples and functions documentation.
GuyliannEngels Aug 20, 2025
f7bc021
add tabularise_*** for glm object
GuyliannEngels Aug 20, 2025
ee50647
add lm_, glm_, nls_ functions
GuyliannEngels Aug 20, 2025
efdcd34
modification in .extract_footer_glm
GuyliannEngels Aug 20, 2025
7064a9d
common internal functions for lm, summary.lm, glm, etc. are now centr…
GuyliannEngels Aug 20, 2025
b334a33
Replace eval_data_dot() bu prepare_data_dot() and recall_with_data_dot()
GuyliannEngels Aug 20, 2025
a1a4e61
Adaptation to changes in data.io/svBase/svMisc/equatiomatic/tabularise
phgrosjean Aug 28, 2025
9a9456e
Merge branch 'main' into refactoring
GuyliannEngels Aug 28, 2025
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
36 changes: 19 additions & 17 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: modelit
Type: Package
Version: 1.4.6
Title: Statistical Models for 'SciViews::R'
Version: 1.4.8
Title: 'SciViews::R' - Statistical Models
Description: Create and use statistical models (linear, general, nonlinear...)
with extensions to support rich-formatted tables, equations and plots for the
'SciViews::R' dialect.
Expand All @@ -17,38 +17,40 @@ Depends:
R (>= 4.2.0),
broom (>= 1.0.4)
Imports:
chart (>= 1.5.0),
data.io (>= 1.5.0),
flextable (>= 0.9.1),
generics (>= 0.1.3),
ggplot2 (>= 3.4.2),
knitr (>= 1.42),
modelr (>= 0.1.11),
officer (>= 0.6.2),
rlang (>= 1.1.1),
stats (>= 4.2.0),
svFlow (>= 1.2.0),
tabularise (>= 0.6.0)
chart (>= 1.5.0),
equatiomatic (>= 0.4.4),
flextable (>= 0.9.1),
generics (>= 0.1.3),
ggplot2 (>= 3.4.2),
knitr (>= 1.42),
modelr (>= 0.1.11),
officer (>= 0.6.2),
rlang (>= 1.1.1),
stats (>= 4.2.0),
svBase (>= 1.7.0),
svFlow (>= 1.2.0),
tabularise (>= 0.6.0)
Suggests:
data.io (>= 1.7.0),
broom.mixed (>= 0.2.9.4),
datasets (>= 4.2.0),
dplyr (>= 1.1.4),
equatags (>= 0.2.0),
equatiomatic (>= 0.3.0),
parsnip (>= 1.1.0),
rmarkdown (>= 2.21),
spelling (>= 2.2.1),
testthat (>= 3.0.0)
Remotes:
SciViews/data.io,
SciViews/chart,
SciViews/data.io,
SciViews/svBase,
SciViews/svFlow,
SciViews/tabularise
License: MIT + file LICENSE
URL: https://github.com/SciViews/modelit, https://www.sciviews.org/modelit/
BugReports: https://github.com/SciViews/modelit/issues
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
VignetteBuilder: knitr
Encoding: UTF-8
Language: en-US
Expand Down
20 changes: 18 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

S3method(AIC,model_fit)
S3method(BIC,model_fit)
S3method(anova,lm_)
S3method(anova,model_fit)
S3method(as.function,lm)
S3method(as.function,model_fit)
Expand All @@ -24,6 +25,7 @@ S3method(nobs,model_fit)
S3method(plot,model_fit)
S3method(residuals,model_fit)
S3method(rstandard,model_fit)
S3method(summary,lm_)
S3method(summary,model_fit)
S3method(tabularise_coef,glm)
S3method(tabularise_coef,lm)
Expand All @@ -32,6 +34,7 @@ S3method(tabularise_coef,summary.glm)
S3method(tabularise_coef,summary.lm)
S3method(tabularise_coef,summary.nls)
S3method(tabularise_default,anova)
S3method(tabularise_default,aov)
S3method(tabularise_default,glm)
S3method(tabularise_default,lm)
S3method(tabularise_default,nls)
Expand All @@ -50,20 +53,25 @@ S3method(variable.names,model_fit)
S3method(vcov,model_fit)
export(add_predictions)
export(add_residuals)
export(anova_)
export(autoplot.lm)
export(autoplot.nls)
export(fit_model)
export(geom_ref_line)
export(glm_)
export(lm_)
export(mae)
export(nls_)
export(qae)
export(rmse)
export(rsquare)
export(summary_)
importFrom(broom,augment)
importFrom(broom,glance)
importFrom(broom,tidy)
importFrom(chart,chart)
importFrom(chart,combine_charts)
importFrom(data.io,label)
importFrom(equatiomatic,equation)
importFrom(flextable,add_footer_lines)
importFrom(flextable,add_header_lines)
importFrom(flextable,align)
Expand Down Expand Up @@ -123,10 +131,18 @@ importFrom(stats,residuals)
importFrom(stats,rstandard)
importFrom(stats,variable.names)
importFrom(stats,vcov)
importFrom(svBase,gettext_)
importFrom(svBase,gettextf_)
importFrom(svBase,label)
importFrom(svBase,ngettext_)
importFrom(svBase,prepare_data_dot)
importFrom(svBase,recall_with_data_dot)
importFrom(svBase,stop_)
importFrom(svBase,warning_)
importFrom(svFlow,"%>.%")
importFrom(tabularise,colformat_sci)
importFrom(tabularise,equation)
importFrom(tabularise,para_md)
importFrom(tabularise,tabularise)
importFrom(tabularise,tabularise_coef)
importFrom(tabularise,tabularise_default)
importFrom(tabularise,tabularise_glance)
Expand Down
30 changes: 30 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
# modelit 1.4.8

- Dependency to svBase and equatiomatic updated, and dependencies to data.io and svMisc eliminated.

- Refactored all tabularise\_\*\*\*() methods for glm, summary.glm, anova, aov objects (e.g., tabularise_glance.glm(), tabularise_default.glm(), tabularise_tidy.glm(), etc.) to improve internal consistency and prepare for multi-format table rendering using {flextable}, {tinytable}, and {gt}.

- added summary\_() and anova\_() functions. These two functions provide the same information as the summary() and anova() functions. They add an attribute that preserves a link to the object used in these two functions. Adding this argument makes it possible to retrieve information from the original object that would otherwise be lost when using summary() or anova().

- Added the experimental glm\_() and nls\_() functions, which extend [stats::glm()] and [stats::nls()] by attaching additional metadata such as variable labels and units. The order of arguments has been modified to start with data =. All three functions — lm\_(), glm\_(), and nls\_() — use a data-dot mechanism inspired by svMisc::eval_data_dot(). Note: nls\_() uses model = TRUE by default, whereas the base nls() function uses model = FALSE.

- The `equation=` argument now accepts `NA` in addition to `TRUE`, `FALSE`, and character strings, offering more flexibility in how model equations are displayed and used:

- `TRUE` *(default)*: The equation is automatically generated and added to the table header. Its parameters are also used in the "Term" column.

- `FALSE`: No equation is generated or displayed, and its parameters are not used in the "Term" column.

- `NA`: The equation is generated but not displayed in the table header. Its parameters are still used in the "Term" column.

- *Character string*: A custom equation is provided directly and added to the table header.

This enhancement allows for finer control over equation display and ensures that model parameters remain accessible even when the equation is hidden.

# modelit 1.4.7

- Refactored all tabularise\_\*\*\*() methods for lm, summary.lm, nls, summary.nls objects (e.g., tabularise_glance.lm(), tabularise_default.lm(), tabularise_tidy.lm(), etc.) to improve internal consistency and prepare for multi-format table rendering using {flextable}, {tinytable}, and {gt}.

- Labels are now fully integrated into tabularise\_\*\*\*.nls and tabularise\_\*\*\*.summary.nls, allowing consistent and readable output for nonlinear model summaries.

- Added the experimental lm\_() function, which extends [stats::lm()] by attaching additional metadata such as variable labels and units. Also introduced summary.lm\_() and anova.lm\_() methods to preserve the additional metadata.

# modelit 1.4.6

- Better selection of X and Y variables in `chart.nls()` and `autoplot.nls()`.
Expand Down
4 changes: 2 additions & 2 deletions R/chart.lm.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#' chart(trees_lm5, origdata = trees) # origdata required here!
chart.lm <- function(data, type = "model", ..., origdata = NULL, title,
labels = "AUTO", name = deparse(substitute(data)),
lang = getOption("data.io_lang", "en"), env = parent.frame()) {
lang = getOption("SciViews_lang", "en"), env = parent.frame()) {
if (type == "residuals") {
a <- autoplot.lm(data, ..., name = name, type = "resfitted",
title = "", lang = lang, env = env)
Expand Down Expand Up @@ -95,7 +95,7 @@ autoplot.lm <- function(object, origdata = NULL,
type = c("model", "resfitted", "qqplot", "scalelocation", "cooksd",
"resleverage", "cookleverage", "reshist", "resautocor"), title, xlab, ylab,
..., name = deparse(substitute(object)),
lang = getOption("data.io_lang", "en"), env = parent.frame()) {
lang = getOption("SciViews_lang", "en"), env = parent.frame()) {
# TODO: chart style if invoked via chart(), otherwise default ggplot theme
# TODO: lindia::resx() but several plots for more complex formulas and one
# could question the validity of this plot as the distrubition of residuals
Expand Down
4 changes: 2 additions & 2 deletions R/chart.nls.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#' # The four most important residual analysis plots in one figure
#' chart$residuals(chick1_logis)
chart.nls <- function(data, type = "model", ..., title, labels = "AUTO",
name = deparse(substitute(data)), lang = getOption("data.io_lang", "en"),
name = deparse(substitute(data)), lang = getOption("SciViews_lang", "en"),
env = parent.frame()) {
if (type == "residuals") {
a <- autoplot.nls(data, ..., name = name, type = "resfitted",
Expand Down Expand Up @@ -79,7 +79,7 @@ class(chart.nls) <- c("function", "subsettable_type")
autoplot.nls <- function(object,
type = c("model", "resfitted", "qqplot", "scalelocation", "reshist",
"resautocor"), title, xlab, ylab, ..., name = deparse(substitute(object)),
lang = getOption("data.io_lang", "en"), env = parent.frame()) {
lang = getOption("SciViews_lang", "en"), env = parent.frame()) {
# TODO: chart style if invoked via chart(), otherwise default ggplot theme

# Needed to avoid spurious R CMD check errors
Expand Down
Loading
Loading