Skip to contents

Deprecated in favour of fucntionality from the `prefio` package. Writes a set of ballots to a new file. This follows the ballot:count standard, with a header describing the candidates.

Usage

write_ballots(ballots, filename = "", return_lines = FALSE, suppress = FALSE)

Arguments

ballots

The ranked_ballots to write to a file.

filename

The name of the file to write to, or "" to write output to stdout.

return_lines

A flag which determines whether or not the output should be returned as a character vector

suppress

A flag which, when True, suppresses any output to stdout.

Examples

write_ballots(ranked_ballots(c(LETTERS)), tempfile("test.txt"))
#> Warning: `write_ballots` is deprecated in favour of `prefio::write_preflib`.
#> Warning: `ranked_ballots` is deprecated in favour of `prefio::preferences`.
write_ballots(ranked_ballots(c(LETTERS)))
#> Warning: `write_ballots` is deprecated in favour of `prefio::write_preflib`.
#> Warning: `ranked_ballots` is deprecated in favour of `prefio::preferences`.
#> A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z
#> A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z
#> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#> (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) : 1