cummode: Cumulative Mode

Description Usage Arguments Value Author(s) References See Also Examples

Description

Returns a list whose elements are the cumulative statistical mode(s) of the elements of the argument.

Usage

1

Arguments

x

a numeric vector.

Value

A list of the same length as x with numeric vectors. NA values are also counted.

Author(s)

Arturo Erdely.

References

Kotz, S., Balakrishnan, N., Read, C.B, Vidakovic, B., Johnson, N.L. (2006) Encyclopedia of Statistical Sciences. Wiley, New Jersey.

See Also

Mode

Examples

1
2
3
4
5
6
7
cummode(c(rep(1, 2), rep(12, 5), rep(44, 3), rep(8, 5), 55))

cummode(c(rep(1, 2), rep(12, 5), rep(44, 3), rep(8, 5), rep(NA, 7), 55))

cummode(runif(5))

cummode(c(rep("a", 2), rep("b", 5), rep("d", 3), rep("e", 5), rep(NA, 5)))

Example output

[[1]]
[1] 1

[[2]]
[1] 1

[[3]]
[1] 1

[[4]]
[1]  1 12

[[5]]
[1] 12

[[6]]
[1] 12

[[7]]
[1] 12

[[8]]
[1] 12

[[9]]
[1] 12

[[10]]
[1] 12

[[11]]
[1] 12

[[12]]
[1] 12

[[13]]
[1] 12

[[14]]
[1] 12

[[15]]
[1] 12  8

[[16]]
[1] 12  8

[[1]]
[1] 1

[[2]]
[1] 1

[[3]]
[1] 1

[[4]]
[1]  1 12

[[5]]
[1] 12

[[6]]
[1] 12

[[7]]
[1] 12

[[8]]
[1] 12

[[9]]
[1] 12

[[10]]
[1] 12

[[11]]
[1] 12

[[12]]
[1] 12

[[13]]
[1] 12

[[14]]
[1] 12

[[15]]
[1] 12  8

[[16]]
[1] 12  8

[[17]]
[1] 12  8

[[18]]
[1] 12  8

[[19]]
[1] 12  8

[[20]]
[1] 12  8 NA

[[21]]
[1] NA

[[22]]
[1] NA

[[23]]
[1] NA

[[1]]
[1] 0.4753646

[[2]]
[1] 0.4753646 0.6396554

[[3]]
[1] 0.4753646 0.6396554 0.4064426

[[4]]
[1] 0.4753646 0.6396554 0.4064426 0.5233317

[[5]]
[1] 0.4753646 0.6396554 0.4064426 0.5233317 0.6360548

[[1]]
[1] "a"

[[2]]
[1] "a"

[[3]]
[1] "a"

[[4]]
[1] "a" "b"

[[5]]
[1] "b"

[[6]]
[1] "b"

[[7]]
[1] "b"

[[8]]
[1] "b"

[[9]]
[1] "b"

[[10]]
[1] "b"

[[11]]
[1] "b"

[[12]]
[1] "b"

[[13]]
[1] "b"

[[14]]
[1] "b"

[[15]]
[1] "b" "e"

[[16]]
[1] "b" "e"

[[17]]
[1] "b" "e"

[[18]]
[1] "b" "e"

[[19]]
[1] "b" "e"

[[20]]
[1] "b" "e" NA 

cumstats documentation built on May 2, 2019, 3:04 a.m.