Skip to content

Commit

Permalink
Updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
timbeechey committed Feb 15, 2024
1 parent ede1bbf commit dd86fab
Show file tree
Hide file tree
Showing 17 changed files with 61 additions and 31 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: opa
Type: Package
Title: An Implementation of Ordinal Pattern Analysis
Version: 0.8.1.030
Version: 0.8.1.031
Authors@R: person("Timothy", "Beechey", email = "[email protected]",
role = c("aut", "cre"), comment = c(ORCID = "0000-0001-8858-946X"))
Description: Quantifies hypothesis to data fit for repeated measures
Expand Down
45 changes: 30 additions & 15 deletions R/utility.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ print.opahypothesis <- function(x, ...) {
#' dat <- data.frame(t1 = c(9, 4, 8, 10),
#' t2 = c(8, 8, 12, 10),
#' t3 = c(8, 5, 10, 11))
#' opamod <- opa(dat, 1:3)
#' h <- hypothesis(1:3)
#' opamod <- opa(dat, h)
#' summary(opamod)
#' summary(opamod, digits = 3)
#' @export
Expand Down Expand Up @@ -117,7 +118,8 @@ summary.opafit <- function(object, ..., digits = 2L) {
#' dat <- data.frame(t1 = c(9, 4, 8, 10),
#' t2 = c(8, 8, 12, 10),
#' t3 = c(8, 5, 10, 11))
#' opamod <- opa(dat, 1:3)
#' h <- hypothesis(1:3)
#' opamod <- opa(dat, h)
#' pw <- compare_conditions(opamod)
#' print(pw)
#' print(pw, digits = 2)
Expand Down Expand Up @@ -153,7 +155,8 @@ print.pairwiseopafit <- function(x, ...) {
#' dat <- data.frame(t1 = c(9, 4, 8, 10),
#' t2 = c(8, 8, 12, 10),
#' t3 = c(8, 5, 10, 11))
#' opamod <- opa(dat, 1:3)
#' h <- hypothesis(1:3)
#' opamod <- opa(dat, h)
#' print(opamod)
#' @export
print.opafit <- function(x, ...) {
Expand All @@ -171,7 +174,8 @@ print.opafit <- function(x, ...) {
#' dat <- data.frame(t1 = c(9, 4, 8, 10),
#' t2 = c(8, 8, 12, 10),
#' t3 = c(8, 5, 10, 11))
#' opamod <- opa(dat, 1:3)
#' h <- hypothesis(1:3)
#' opamod <- opa(dat, h)
#' pcc_plot(opamod)
#' pcc_plot(opamod, threshold = 85)
#' @export
Expand Down Expand Up @@ -254,7 +258,8 @@ pcc_plot.opafit <- function(m, threshold = NULL, title = TRUE, legend = TRUE) {
#' dat <- data.frame(t1 = c(9, 4, 8, 10),
#' t2 = c(8, 8, 12, 10),
#' t3 = c(8, 5, 10, 11))
#' opamod <- opa(dat, 1:3)
#' h <- hypothesis(1:3)
#' opamod <- opa(dat, h)
#' cval_plot(opamod)
#' cval_plot(opamod, threshold = 0.1)
#' @export
Expand Down Expand Up @@ -338,7 +343,8 @@ cval_plot.opafit <- function(m, threshold = NULL, title = TRUE, legend = TRUE) {
#' dat <- data.frame(t1 = c(9, 4, 8, 10),
#' t2 = c(8, 8, 12, 10),
#' t3 = c(8, 5, 10, 11))
#' opamod <- opa(dat, 1:3)
#' h <- hypothesis(1:3)
#' opamod <- opa(dat, h)
#' plot(opamod)
#' @export
plot.opafit <- function(x, pcc_threshold = NULL, cval_threshold = NULL, ...) {
Expand Down Expand Up @@ -398,7 +404,8 @@ plot.opahypothesis <- function(x, title = TRUE, ...) {
#' dat <- data.frame(t1 = c(9, 4, 8, 10),
#' t2 = c(8, 8, 12, 10),
#' t3 = c(8, 5, 10, 11))
#' opamod <- opa(dat, 1:3)
#' h <- hypothesis(1:3)
#' opamod <- opa(dat, h)
#' group_results(opamod)
#' @export
group_results <- function(m, digits) {
Expand Down Expand Up @@ -444,7 +451,8 @@ group_results.opafit <- function(m, digits = 2) {
#' dat <- data.frame(t1 = c(9, 4, 8, 10),
#' t2 = c(8, 8, 12, 10),
#' t3 = c(8, 5, 10, 11))
#' opamod <- opa(dat, 1:3)
#' h <- hypothesis(1:3)
#' opamod <- opa(dat, h)
#' individual_results(opamod)
#' @export
individual_results <- function(m, digits) {
Expand Down Expand Up @@ -478,7 +486,8 @@ individual_results.opafit <- function(m, digits = 2) {
#' dat <- data.frame(t1 = c(9, 4, 8, 10),
#' t2 = c(8, 8, 12, 10),
#' t3 = c(8, 5, 10, 11))
#' opamod <- opa(dat, 1:3)
#' h <- hypothesis(1:3)
#' opamod <- opa(dat, h)
#' group_pccs(opamod)
#' @export
group_pccs <- function(m) {
Expand Down Expand Up @@ -509,7 +518,8 @@ group_pccs.pairwiseopafit <- function(m) {
#' dat <- data.frame(t1 = c(9, 4, 8, 10),
#' t2 = c(8, 8, 12, 10),
#' t3 = c(8, 5, 10, 11))
#' opamod <- opa(dat, 1:3)
#' h <- hypothesis(1:3)
#' opamod <- opa(dat, h)
#' group_cvals(opamod)
#' @export
group_cvals <- function(m) {
Expand Down Expand Up @@ -540,7 +550,8 @@ group_cvals.pairwiseopafit <- function(m) {
#' dat <- data.frame(t1 = c(9, 4, 8, 10),
#' t2 = c(8, 8, 12, 10),
#' t3 = c(8, 5, 10, 11))
#' opamod <- opa(dat, 1:3)
#' h <- hypothesis(1:3)
#' opamod <- opa(dat, h)
#' individual_pccs(opamod)
#' @export
individual_pccs <- function(m) {
Expand All @@ -565,7 +576,8 @@ individual_pccs.opafit <- function(m) {
#' dat <- data.frame(t1 = c(9, 4, 8, 10),
#' t2 = c(8, 8, 12, 10),
#' t3 = c(8, 5, 10, 11))
#' opamod <- opa(dat, 1:3)
#' h <- hypothesis(1:3)
#' opamod <- opa(dat, h)
#' individual_cvals(opamod)
#' @export
individual_cvals <- function(m) {
Expand All @@ -590,7 +602,8 @@ individual_cvals.opafit <- function(m) {
#' dat <- data.frame(t1 = c(9, 4, 8, 10),
#' t2 = c(8, 8, 12, 10),
#' t3 = c(8, 5, 10, 11))
#' opamod <- opa(dat, 1:3)
#' h <- hypothesis(1:3)
#' opamod <- opa(dat, h)
#' random_pccs(opamod)
#' @export
random_pccs <- function(m) {
Expand All @@ -615,7 +628,8 @@ random_pccs.opafit <- function(m) {
#' dat <- data.frame(t1 = c(9, 4, 8, 10),
#' t2 = c(8, 8, 12, 10),
#' t3 = c(8, 5, 10, 11))
#' opamod <- opa(dat, 1:3)
#' h <- hypothesis(1:3)
#' opamod <- opa(dat, h)
#' correct_pairs(opamod)
#' @export
correct_pairs <- function(m) {
Expand All @@ -640,7 +654,8 @@ correct_pairs.opafit <- function(m) {
#' dat <- data.frame(t1 = c(9, 4, 8, 10),
#' t2 = c(8, 8, 12, 10),
#' t3 = c(8, 5, 10, 11))
#' opamod <- opa(dat, 1:3)
#' h <- hypothesis(1:3)
#' opamod <- opa(dat, h)
#' incorrect_pairs(opamod)
#' @export
incorrect_pairs <- function(m) {
Expand Down
3 changes: 2 additions & 1 deletion man/correct_pairs.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/cval_plot.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/group_cvals.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/group_pccs.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/group_results.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/incorrect_pairs.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/individual_cvals.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/individual_pccs.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/individual_results.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/pcc_plot.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.opafit.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/print.opafit.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/print.pairwiseopafit.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/random_pccs.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/summary.opafit.Rd

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

0 comments on commit dd86fab

Please sign in to comment.