join_scores: Join scores of multiple models into a list

Description Usage Arguments Value See Also Examples

View source: R/mm2_join_data.R

Description

The join_scores function takes predicted scores from multiple models and converts them to a list.

Usage

1
join_scores(..., byrow = FALSE, chklen = TRUE)

Arguments

...

Multiple datasets. They can be vectors, arrays, matrices, data frames, and lists.

byrow

A Boolean value to specify whether row vectors are used for matrix, data frame, and array.

chklen

A Boolean value to specify whether all list items must be the same lengths.

Value

The join_scores function returns a list that contains all combined score data.

See Also

evalmod for calculation evaluation measures. mmdata for formatting input data. join_labels for formatting labels with multiple datasets.

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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
##################################################
### Add three numeric vectors
###
s1 <- c(1, 2, 3, 4)
s2 <- c(5, 6, 7, 8)
s3 <- c(2, 4, 6, 8)
scores1 <- join_scores(s1, s2, s3)

## Show the list structure
str(scores1)


##################################################
### Add a matrix and a numeric vector
###
a1 <- matrix(seq(8), 4, 2)
scores2 <- join_scores(a1, s3)

## Show the list structure
str(scores2)


##################################################
### Use byrow
###
a2 <- matrix(seq(8), 2, 4, byrow = TRUE)
scores3 <- join_scores(a2, s3, byrow = TRUE)

## Show the list structure
str(scores3)


##################################################
### Use chklen
###
s4 <- c(1, 2, 3)
s5 <- c(5, 6, 7, 8)
scores4 <- join_scores(s4, s5, chklen = FALSE)

## Show the list structure
str(scores4)

guillermozbta/precrec documentation built on Jan. 3, 2018, 12:52 a.m.