project ./, which is rarely a good idea. If this is unexpected, the here package has a function, here::dr_here() that reveals why ./ is regarded as a project. Do you want to create anyway? 1: Absolutely 2: Absolutely not 3: Nope Selection: 1 The way to CRAN 11
BJ2025 Title: What the Package Does (One Line, Title Case) Version: 0.0.0.9000 Authors@R (parsed): * First Last [email protected] [aut, cre] (YOUR-ORCID-ID) Description: What the package does (one paragraph). License: use_mit_license() , use_gpl3_license() or friends to pick a license Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.2 The way to CRAN 12
Definitely 3: Nope Selection: 2 Writing BJ2025.Rproj. Adding "^BJ2025\.Rproj " to .Rbuildignore. ✔ Adding ".Rproj.user" to .gitignore. ✔ Adding "^\\.Rproj\\.user " to .Rbuildignore. Setting active project to "<no active project>". The way to CRAN 13
#' A general function that returns the model fit indices. #' @param U U is either a data class of exametrika, or raw data. When raw data is given, #' it is converted to the exametrika class with the [dataFormat] function. #' @param Z Z is a missing indicator matrix of the type matrix or data.frame #' @param ell_A log likelihood of this model #' @param nparam number of parameters for this model #' @return #' \describe{ #' \item{model_log_like}{log likelihood of analysis model} #' \item{bench_log_like}{log likelihood of benchmark model} #' \item{null_log_like}{log likelihood of null model} #' \item{model_Chi_sq}{Chi-Square statistics for analysis model} #' \item{null_Chi_sq}{Chi-Square statistics for null model} #' \item{model_df}{degrees of freedom of analysis model} #' \item{null_df}{degrees of freedom of null model} #' \item{NFI}{Normed Fit Index. Lager values closer to 1.0 indicate a better fit.} #' \item{RFI}{Relative Fit Index. Lager values closer to 1.0 indicate a better fit.} #' \item{IFI}{Incremental Fit Index. Lager values closer to 1.0 indicate a better fit.} #' \item{TLI}{Tucker-Lewis Index. Lager values closer to 1.0 indicate a better fit.} #' \item{CFI}{Comparative Fit Index. Lager values closer to 1.0 indicate a better fit.} #' \item{RMSEA}{Root Mean Square Error of Approximation. Smaller values closer to 0.0 indicate a better fit.} #' \item{AIC}{Akaike Information Criterion. A lower value indicates a better fit.} #' \item{CAIC}{Consistent AIC.A lower value indicates a better fit.} #' \item{BIC}{Bayesian Information Criterion. A lower value indicates a better fit.} #' } #' @export ItemFit <- function(U, Z, ell_A, nparam) { The way to CRAN 26
with Multiple Metrics #' #' @title Comprehensive Student Test Analysis #' @description #' This function performs a comprehensive analysis of student test responses, #' calculating various educational measurement metrics including number right scores, #' passage rates, standard scores, percentiles, and stanine scores. #' #' @param U Matrix or data frame of item responses (students x items) #' @param na Value to be treated as missing (default = NULL) #' @param Z Optional matrix of auxiliary information (default = NULL) #' @param w Optional vector of item weights (default = NULL) #' #' @return A data frame containing the following columns: #' \itemize{ #' \item ID - Student identifiers #' \item NR - Number of items responded (excluding NA) #' \item NRS - Number right score #' \item PR - Passage rate #' \item SS - Standard score #' \item Percentile - Percentile rank #' \item Stanine - Stanine score (1-9 scale) #' } #' #' @details #' The function processes raw item responses and calculates multiple educational #' measurement metrics. It handles missing values and can incorporate item weights #' and auxiliary information if provided. #' #' @examples #' \dontrun{ #' # Basic usage with response matrix #' results <- StudentAnalysis(U = response_matrix) #' #' # With missing value specification #' results <- StudentAnalysis(U = response_matrix, na = 9) The way to CRAN 28
NULL, Z = NULL, w = NULL, verbose = TRUE) { # data format if (!inherits(U, "exametrika")) { tmp <- dataFormat(data = U, na = na, Z = Z, w = w) } else { tmp <- U } ... 入力されたオブジェクト U のクラスを inherits 関数でチェックしてます。 The way to CRAN 32
exametrika と exametrikaData を付与してリターンする。 # Return with appropriate class structure ret <- structure(ret.list, class = c("exametrika", "exametrikaData")) return(ret) ver`1.0から1.1に上げる際に,多値データにも対応させようということになって, ここを書き換える羽目になったから大変だった!設計方針はなるべくしっかり定めま しょうw The way to CRAN 33
"exametrika")) { if (U$response.type == "binary") { return(LRA.binary(U, ...)) } else if (U$response.type %in% c("rated", "ordinal")) { return(LRA.ordinal(U, ...)) } else { return(LRA.nominal(U, ...)) } } U <- dataFormat(U, na = na, Z = Z, w = w) LRA(U) } The way to CRAN 37
version to ">= 3.0.0" in DESCRIPTION. Adding "3" to Config/testthat/edition. Creating tests/testthat/. Writing tests/testthat.R. ☐ Call usethis::use_test() to initialize a basic test file and open it for editing. The way to CRAN 41
usethis::use_cran_comments(open = rlang::is_interactive()) Writing cran-comments.md. Adding "^cran-comments\.md$" to .Rbuildignore. ☐ Modify cran-comments.md. The way to CRAN 57
先方でもビルドチェックがあるので,winduilderからメールが来ますが,これはた だの確認 査読が返ってきたら,コメントの通りに修正して再投稿! cran-comments.md に ## Resubmission のセクションを作って,どこを直し たか書いてあげるといい。 The way to CRAN 58