Skip to content

Commit

Permalink
fix x_var as output
Browse files Browse the repository at this point in the history
  • Loading branch information
AparicioJohan committed Oct 7, 2024
1 parent 615cf07 commit 9d5640c
Show file tree
Hide file tree
Showing 25 changed files with 55 additions and 51 deletions.
3 changes: 2 additions & 1 deletion R/01_read.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ explorer <- function(data, x, y, id, metadata) {
summ_metadata = resum,
locals_min_max = max_min,
dt_long = dt_long,
metadata = .keep
metadata = .keep,
x_var = x
)
class(out) <- "explorer"
return(out)
Expand Down
1 change: 1 addition & 0 deletions R/02_modeler.R
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ modeler <- function(data,
metrics = metrics,
execution = end_time - init_time,
response = variable,
x_var = x$x_var,
keep = .keep,
fun = fn,
parallel = list("parallel" = parallel, "workers" = workers),
Expand Down
5 changes: 3 additions & 2 deletions R/utils_S3_print.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@
#' add_zero = TRUE,
#' max_as_last = TRUE
#' )
#' plot(mod_1, id = c(1:5))
#' plot(mod_1, id = c(1:4))
#' print(mod_1)
print.modeler <- function(x, ...) {
param <- select(x$param, -all_of(x$keep))
trait <- unique(x$dt$var)
chr <- paste(trait, "~", deparse(x$fn))
cat("\nCall:\n")
cat(paste(trait, "~", deparse(x$fn)), "\n")
cat(sub("x", replacement = x$x_var, x = chr, fixed = TRUE), "\n")
cat("\n")
if (nrow(param) == 1) {
cat("Residuals:\n")
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ devtools::install_github("AparicioJohan/flexFitR")
* Parameter Estimation: Utilizes `{optimx}` and derivative-free algorithms to solve and estimate parameters for a given function.
* Parallelization: Implements parallel processing using the `{future}` package, enabling efficient fitting of hundreds of curves simultaneously.
* Visualization Tools: Provides a variety of plots to visualize model fits, correlations, predictions, and more.
* Statistical Rigor: Offers standard errors and p-values for coefficients, supporting robust conclusions and interpretations.
* Statistical Rigor: Offers standard errors and p-values for coefficients, as well as for predictions, supporting robust conclusions and interpretations.
* Prediction: Facilitates the prediction of non-observed data points.
* Flexibility: Allows users to fix certain parameters in the model and specify different initial values per grouping factor.
* Custom Modeling Functions: Equipped with built-in modeling functions for common analysis tasks, while also permitting users to supply their own custom functions.
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ devtools::install_github("AparicioJohan/flexFitR")
- Visualization Tools: Provides a variety of plots to visualize model
fits, correlations, predictions, and more.
- Statistical Rigor: Offers standard errors and p-values for
coefficients, supporting robust conclusions and interpretations.
coefficients, as well as for predictions, supporting robust
conclusions and interpretations.
- Prediction: Facilitates the prediction of non-observed data points.
- Flexibility: Allows users to fix certain parameters in the model and
specify different initial values per grouping factor.
Expand Down Expand Up @@ -85,7 +86,7 @@ mod_1 <- dt |>
print(mod_1)

Call:
variable ~ fun(x, t1, t2, k)
variable ~ fun(time, t1, t2, k)

Residuals:
Min. 1st Qu. Median Mean 3rd Qu. Max.
Expand All @@ -96,8 +97,8 @@ Optimization Results `head()`:
1 38.6 61 99.8 0.449

Metrics:
Groups Timing Convergence Iterations
1 0.4068 secs 100% 511 (id)
Groups Timing Convergence Iterations
1 0.354 secs 100% 511 (id)
```

``` r
Expand Down
6 changes: 3 additions & 3 deletions docs/articles/canopy-model.html

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

2 changes: 1 addition & 1 deletion docs/articles/height-model.html

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

18 changes: 9 additions & 9 deletions docs/articles/how_to_start.html

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

2 changes: 1 addition & 1 deletion docs/articles/maturity-model.html

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

4 changes: 2 additions & 2 deletions docs/articles/plotting.html

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

8 changes: 4 additions & 4 deletions docs/index.html

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

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ articles:
how_to_start: how_to_start.html
maturity-model: maturity-model.html
plotting: plotting.html
last_built: 2024-10-07T15:34Z
last_built: 2024-10-07T16:06Z
urls:
reference: https://apariciojohan.github.io/flexFitR/reference
article: https://apariciojohan.github.io/flexFitR/articles
4 changes: 2 additions & 2 deletions docs/reference/coef.modeler.html

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

Loading

0 comments on commit 9d5640c

Please sign in to comment.