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

Cron job #378

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion .github/workflows/test_as_cran.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ on:
pull_request:
branches: [ "main", "development" ]
workflow_dispatch:

# every second month
schedule:
- cron: '0 9 5 1,3,5,7,9,11 *'

permissions:
contents: read

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ on:
pull_request:
branches: ["main", "development"]
workflow_dispatch:

# every second month
schedule:
- cron: '0 9 5 1,3,5,7,9,11 *'

permissions:
contents: read

Expand Down
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Description: Provides regularized structural equation modeling
['lslx'](<https://github.com/psyphh/lslx>) packages.
License: GPL (>= 2)
Encoding: UTF-8
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Roxygen: list(markdown = TRUE)
Depends:
lavaan,
Expand All @@ -24,6 +24,7 @@ Imports:
RcppArmadillo,
RcppParallel,
ggplot2,
ggrepel,
tidyr,
stringr,
numDeriv,
Expand Down
36 changes: 24 additions & 12 deletions R/class-regularizedSEM.R
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ setMethod("BIC", "regularizedSEM", function (object, ...) {
#'
#' @param x object of class gpRegularized
#' @param y not used
#' @param ... use regularizedOnly=FALSE to plot all parameters
#' @param ... use regularizedOnly = FALSE to plot all parameters and addLabels = FALSE
#' to remove labels to the lines
#' @return either an object of ggplot2 or of plotly
#' @export
setMethod("plot",
Expand All @@ -189,6 +190,11 @@ setMethod("plot",
}else{
regularizedOnly <- TRUE
}
if("addLabels" %in% names(list(...))){
addLabels <- list(...)$addLabels
}else{
addLabels <- TRUE
}
parameters <- x@parameters
tuningParameters <- x@parameters[,!colnames(x@parameters)%in%x@parameterLabels,drop=FALSE]
tuningParameters <- tuningParameters[,apply(tuningParameters,2,function(x) length(unique(x)) > 1),drop=FALSE]
Expand Down Expand Up @@ -220,17 +226,23 @@ setMethod("plot",
}

if(nTuning == 1){

return(
ggplot2::ggplot(data = parametersLong,
mapping = ggplot2::aes(
x = .data[[colnames(tuningParameters)]],
y = .data[["value"]],
group = .data[["name"]])) +
ggplot2::geom_line(colour = "#008080")+
ggplot2::ggtitle("Regularized Parameters")
)

plt <- ggplot2::ggplot(data = parametersLong,
mapping = ggplot2::aes(
x = .data[[colnames(tuningParameters)]],
y = .data[["value"]],
group = .data[["name"]])) +
ggplot2::geom_line(colour = "#008080") +
ggplot2::ggtitle("Regularized Parameters") +
ggplot2::theme_bw()
if(addLabels){
plt <- plt +
ggrepel::geom_label_repel(data = plt$data[plt$data[[colnames(tuningParameters)]] ==
min(plt$data[[colnames(tuningParameters)]]), ],
ggplot2::aes(x = .data[[colnames(tuningParameters)]],
y = .data[["value"]],
label = .data[["name"]]))
}
return(plt)
}else{
parametersLong$name <- paste0(parametersLong$name,
"_",
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.
3 changes: 2 additions & 1 deletion man/lessSEM.Rd

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

3 changes: 2 additions & 1 deletion man/plot-regularizedSEM-missing-method.Rd

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

Loading