Open RobinHankin opened 3 years ago
Following shows what we want paste()
to do:
> l <- disord(letters)
> disord(paste(elements(l),"3",sep="_"),h=hash(l))
A disord object with hash 005ae317c931561a05b53fcfa860d7ac61dfec85 and elements
[1] "a_3" "b_3" "c_3" "d_3" "e_3" "f_3" "g_3" "h_3" "i_3" "j_3" "k_3" "l_3"
[13] "m_3" "n_3" "o_3" "p_3" "q_3" "r_3" "s_3" "t_3" "u_3" "v_3" "w_3" "x_3"
[25] "y_3" "z_3"
(in some order)
>
There is some documentation at ?dotsMethods
which might help.
Look:
paste(disord(letters),disord(LETTERS))
[1] "a A" "b B" "c C" "d D" "e E" "f F" "g G" "h H" "i I" "j J" "k K" "l L"
[13] "m M" "n N" "o O" "p P" "q Q" "r R" "s S" "t T" "u U" "v V" "w W" "x X"
[25] "y Y" "z Z"
>
This should (of course) return an error.
Also:
paste(letters,collapse="_")
[1] "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"
paste(disord(letters),collapse="_")
[1] "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"
The first line is fine (of course), but the second line should return an error
Look:
the output should be a
disord
object, not a vector.