manual_reorder: Manually reorder Czekanowski's Diagram

Description Usage Arguments Details Author(s) Examples

View source: R/utils_czek_matrix.R

Description

The function returns a Czekanowski's Diagram with the new order and recalculated factors

Usage

1
manual_reorder(x, v_neworder, ...)

Arguments

x

a matrix with class czek_matrix, czek_matrix_dist or data matrix/data.frame or dist object.

v_neworder

a numeric vector with the new ordering.

...

specifies further parameters that can be passed on to the czek_matrix function or will be present in derived functions. See details and example code.

Details

This is an S3 generic function. The RMaCzek package defines five methods for it:

Author(s)

Krzysztof Bartoszek <krzbar@protonmail.ch>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#'# Set data ####
x<-mtcars
# Calculate Czekanowski's diagram
czkm<-czek_matrix(x)
czkm_dist<-czek_matrix(x,as_dist=TRUE)
# new ordering
neworder<-attr(czkm,"order")
neworder[1:2]<-neworder[2:1]
# reorder the diagram
#if the output was Czekanowski's diagram without the distances
#remembered, then the original data has to be passed so that 
#factors can be recalculated.
new_czkm<-manual_reorder(czkm,v_neworder=neworder,orig_data=x)
new_czkm_dist<-manual_reorder(czkm_dist,v_neworder=neworder)
#we can also pass the original data directly
new_czkm<-manual_reorder(x,v_neworder=neworder)
#and this is equivalent to calling
czkm<-czek_matrix(x,order=neworder)
#up to the value of the "criterion_value" attribute
#which in the second case can be lost, as no information is passed
#on which one was originally used, while in the first case it might
#be impossible to recalculate-only criteria values from seriate are supported
#if a user has a custom seriation function, then they need to recalculate this
#value themselves

RMaCzek documentation built on Jan. 8, 2021, 5:40 p.m.