Skip to content

Commit afcdb73

Browse files
authored
Merge pull request #1461 from dbetebenner/master
Perfecting startup message
2 parents 06b8cd1 + 5967e31 commit afcdb73

File tree

7 files changed

+47
-16
lines changed

7 files changed

+47
-16
lines changed

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ authors:
1111
- family-names: "Shang"
1212
given-names: "Yi"
1313
title: "SGP: Student Growth Percentiles & Percentile Growth Trajectories"
14-
version: 2.2-0.8
14+
version: 2.2-1.0
1515
doi: 10.5281/zenodo.13921157
16-
date-released: 2024-12-3
16+
date-released: 2024-12-4
1717
url: "https://sgp.io"

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: SGP
22
Type: Package
33
Title: Student Growth Percentiles & Percentile Growth Trajectories
4-
Version: 2.2-0.8
5-
Date: 2024-12-3
4+
Version: 2.2-1.0
5+
Date: 2024-12-4
66
Authors@R: c(person(given=c("Damian", "W."), family="Betebenner", email="[email protected]", role=c("aut", "cre"), comment=c(ORCID = "0000-0003-0476-5599")),
77
person(given=c("Adam", "R."), family="Van Iwaarden", email="[email protected]", role="aut"),
88
person(given="Ben", family="Domingue", email="[email protected]", role="aut"),
@@ -76,7 +76,7 @@ Authors@R: c(person(given=c("Damian", "W."), family="Betebenner", email="dbetebe
7676
Maintainer: Damian W. Betebenner <[email protected]>
7777
Depends: R (>= 4.1.0)
7878
Suggests: SGPdata (>= 28.0-0), knitr, rmarkdown
79-
Imports: Cairo, callr, collapse, colorspace, crayon, datasets, data.table (>= 1.14.0), digest, doParallel, equate (>= 2.0-5), foreach, graphics, grid, grDevices, gridBase, iterators, gtools, jsonlite, matrixStats, methods, parallel, quantreg, randomNames (>= 0.0-5), rngtools (>= 1.5), RSQLite, sn (>= 1.0-0), splines, stats, svglite, toOrdinal, utils
79+
Imports: Cairo, callr, collapse, colorspace, crayon, datasets, data.table (>= 1.14.0), digest, doParallel, equate (>= 2.0-5), foreach, graphics, grid, grDevices, gridBase, iterators, gtools, jsonlite, matrixStats, methods, parallel, pkgsearch, quantreg, randomNames (>= 0.0-5), rngtools (>= 1.5), RSQLite, sn (>= 1.0-0), splines, stats, svglite, toOrdinal, utils
8080
Description: An analytic framework for the calculation of norm- and criterion-referenced academic growth estimates using large scale, longitudinal education assessment data as developed in Betebenner (2009) <doi:10.1111/j.1745-3992.2009.00161.x>.
8181
SystemRequirements: (PDF)LaTeX (https://www.latex-project.org/) with 'pdfpages' package for studentGrowthPlot option in visualizeSGP to bind together student growth plots into school catalogs
8282
URL: https://sgp.io, https://github.com/CenterForAssessment/SGP, https://CRAN.R-project.org/package=SGP

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ importFrom(Cairo,Cairo,CairoSVG)
3737
importFrom(callr,r_bg)
3838
importFrom(collapse, add_stub, add_vars, collapv, ffirst, fmean, fmedian, fnrow, fsd, ftransform, ftransformv, fvar, get_vars, join, na_omit, pivot, .quantile, replace_outliers, roworderv, rm_stub)
3939
importFrom(colorspace,rainbow_hcl,diverge_hcl)
40-
importFrom(crayon,bold,green,magenta,red,yellow)
40+
importFrom(crayon,bold,cyan,green,magenta,red,yellow)
4141
importFrom(digest,digest)
4242
importFrom(doParallel,registerDoParallel)
4343
importFrom(equate,freqtab,equate)

R/zzz.R

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,51 @@ function(libname, pkgname) {
55
utils::globalVariables(c("."))
66
}
77

8-
.onAttach <- function(libname, pkgname) {
8+
`.onAttach` <- function(libname, pkgname) {
99
if (interactive()) {
10+
11+
# Function to get the development version
12+
get_dev_version <- function(package) {
13+
url <- paste0("https://raw.githubusercontent.com/CenterForAssessment/", package, "/refs/heads/master/DESCRIPTION")
14+
tryCatch({
15+
lines <- readLines(url, warn = FALSE)
16+
version_line <- grep("^Version:", lines, value = TRUE)
17+
if (length(version_line) > 0) {
18+
return(strsplit(version_line, ": ")[[1]][2])
19+
} else {
20+
return("Unavailable")
21+
}
22+
}, error = function(e) {
23+
return("Unavailable")
24+
}, warning = function(w) {
25+
return("Unavailable")
26+
})
27+
}
28+
29+
1030
# Extract version information
11-
version <- utils::packageVersion("SGP")
31+
installed.version <- utils::packageDescription("SGP")[['Version']]
32+
cran.version <- tryCatch(
33+
pkgsearch::cran_package("SGP")[['Version']],
34+
error = function(e) "Unavailable",
35+
warning = function(w) "Unavailable"
36+
)
37+
dev.version <- get_dev_version("SGP")
1238

1339
# Define a friendly startup message
1440
message_text <- paste0(
15-
magenta(bold("\uD83C\uDF89 SGP v", version)), " - ", toOrdinal::toOrdinalDate("2024-12-3"), "\n",
16-
"\U1F4A1 Tip: ", magenta(bold("> help(\"SGP\")")), "\n",
41+
magenta(bold("\uD83C\uDF89 SGP v", installed.version, sep="")), " - ", toOrdinal::toOrdinalDate("2024-12-4"), "\n",
42+
strrep("\u2501", 40), "\n",
43+
bold("\U1F4E6 CRAN: "), green("v", cran.version, sep=""), "\n",
44+
bold("\U1F527 Dev: "), cyan("v", dev.version, sep=""), "\n",
45+
strrep("\u2501", 40), "\n",
46+
"\U1F4A1 Tip: ", magenta(bold("> help(package=\"SGP\")")), "\n",
1747
"\U1F310 Docs: ", magenta(bold("https://sgp.io/")), "\n",
48+
strrep("\u2501", 40), "\n",
1849
"\u2728 Happy SGPing!"
1950
)
2051

2152
# Display the startup message
2253
packageStartupMessage(message_text)
2354
}
24-
}
55+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ SGP
55
[![R-CMD-check](https://github.com/CenterForAssessment/SGP/workflows/R-CMD-check/badge.svg)](https://github.com/CenterForAssessment/SGP/actions)
66
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/centerforassessment/SGP?branch=master&svg=true)](https://ci.appveyor.com/project/centerforassessment/SGP)
77
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/SGP)](https://cran.r-project.org/package=SGP)
8-
[![Development Version](https://img.shields.io/badge/devel-2.2--0.6-brightgreen.svg)](https://github.com/CenterForAssessment/SGP)
8+
[![Development Version](https://img.shields.io/badge/devel-2.2--0.8-brightgreen.svg)](https://github.com/CenterForAssessment/SGP)
99
[![Rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/grand-total/SGP)](https://github.com/metacran/cranlogs.app)
1010
[![License](https://img.shields.io/badge/license-GPL%203-brightgreen.svg?style=flat)](https://github.com/CenterForAssessment/SGP/blob/master/LICENSE.md)
1111
[![Join the chat at https://gitter.im/CenterForAssessment/SGP](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/CenterForAssessment/SGP?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

inst/CITATION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ bibentry(
99
person(given = c("Yi"), family = "Shang")
1010
),
1111
year = "2024",
12-
note = "R package version 2.2-0.8",
12+
note = "R package version 2.2-1.0",
1313
url = "https://sgp.io",
1414
textVersion = paste(
1515
"Damian W. Betebenner, Adam R. Van Iwaarden, Benjamin Domingue and Yi Shang (2024).",
1616
"SGP: Student Growth Percentiles & Percentile Growth Trajectories.",
17-
"(R package version 2.2-0.8)",
17+
"(R package version 2.2-1.0)",
1818
"URL: https://sgp.io"
1919
)
2020
)

man/SGP-package.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ growth projections to be calculated across assessment transitions by equating th
1919
\tabular{ll}{
2020
Package: \tab SGP\cr
2121
Type: \tab Package\cr
22-
Version: \tab 2.2-0.8\cr
23-
Date: \tab 2024-12-3\cr
22+
Version: \tab 2.2-1.0\cr
23+
Date: \tab 2024-12-4\cr
2424
License: \tab GPL-3\cr
2525
LazyLoad: \tab yes\cr
2626
}

0 commit comments

Comments
 (0)