Type: Package
Title: Sample and Precomputed Data for Use with 'exams.forge'
Version: 0.1.2
Description: Provides a small collection of datasets supporting Pearson correlation and linear regression analysis. It includes the precomputed dataset 'sos100', with integer values summing to zero and squared sum equal to 100. For other values of 'n' and user-defined parameters, the 'sos()' function from the 'exams.forge' package can be used to generate datasets on the fly. In addition, the package contains around 500 R Markdown exercises that illustrate the usage of 'exams.forge' commands.
License: GPL-3
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.3
Depends: R (≥ 3.5)
Suggests: AER, knitr, rmarkdown
Imports: exams, exams.forge
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2025-09-11 06:26:37 UTC; sigbert
Author: Sigbert Klinke ORCID iD [aut, cre]
Maintainer: Sigbert Klinke <sigbert@hu-berlin.de>
Repository: CRAN
Date/Publication: 2025-09-11 06:40:02 UTC

Precomputed Sum of Squared Data

Description

A data matrix with precomputed results from sumofsquares(n, 10, zerosum=TRUE, maxt=Inf) for n=100.

More generally, the sos() function can be used to retrieve or compute results from sumofsquares(n, nmax, zerosum=TRUE, maxt=Inf).

Usage

data(sos100)

Format

For each line of the matrix it holds \sum_{i=1}^k x_i^2=n and \sum_{i=1}^k x_i=0. It contains all integer solutions up to k <= 10. NA means that this entry is not used.

Examples

data(sos100)
head(sos100)
rowSums(sos100^2, na.rm=TRUE)
rowSums(sos100, na.rm=TRUE)

Explore and Render Exam Exercises

Description

This function allows the user to explore exercises from the exams.forge.data package and optionally render them to PDF or HTML. Users can filter exercises by directory (topic) or by a pattern in filenames or file contents.

Usage

view(
  action = c("topic", "file", "pdf", "html"),
  pattern = NULL,
  topic = TRUE,
  ...
)

Arguments

action

Character. One of "topic", "file", "pdf", or "html".

  • "topic": return the list of available exercise topics (subdirectories).

  • "file": return the list of exercise filenames relative to ⁠aufgaben/⁠.

  • "pdf": render selected exercises to PDF.

  • "html": render selected exercises to HTML.

pattern

Character or NULL. A regular expression to filter exercises. If topic = TRUE, the pattern is matched against the directory names (topics). If topic = FALSE, the pattern is searched inside the exercise files.

topic

Logical. If TRUE (default), pattern is applied to directory names. If FALSE, pattern is applied to the content of the exercise files.

...

Additional arguments passed to grepl() when filtering files or contents.

Value

A character vector of topics or filenames, or NULL if no exercises are found. When rendering (pdf/html), the files are rendered silently with messages and warnings suppressed.

Examples


view("topic")

# List all files in a specific topic
view("file", pattern = "ttest", topic = TRUE)

if (interactive()) {
# Render the files matching a pattern to HTML
  view("file", pattern = "hyper")
  view("html", pattern = "hyper")
}