scrabble               package:UsingR               R Documentation

_D_i_s_t_r_i_b_u_t_i_o_n _o_f _S_c_r_a_b_b_l_e _p_i_e_c_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Distribution and point values of letters in Scrabble.

_U_s_a_g_e:

     data(scrabble)

_F_o_r_m_a_t:

     A data frame with 27 observations on the following 3 variables.

     _p_i_e_c_e Which piece

     _p_o_i_n_t_s point value

     _f_r_e_q_u_e_n_c_y Number of pieces

_D_e_t_a_i_l_s:

     Scrabble is a popular board game based on forming words from the
     players' pieces. These consist of letters drawn from a pile at
     random. The game has a certain frequency of letters given by this
     data. These match fairly well with the letter distribution of the
     English language.

_E_x_a_m_p_l_e_s:

     data(scrabble)
     ## perform chi-squared analysis on long string. Is it in English?
     quote = " R is a language and environment for statistical computing  \
     and graphics. It is a GNU project which is similar to the S language \
     and environment which was developed at Bell Laboratories (formerly   \
     AT&T, now Lucent Technologies) by John Chambers and colleagues. R    \
     can be considered as a different implementation of S. There are      \
     some important differences, but much code written for S runs         \
     unaltered under R."
     quote.lc = tolower(quote)
     quote = unlist(strsplit(quote.lc,""))
     ltr.dist = sapply(c(letters," "),function(x) sum(quote == x))
     chisq.test(ltr.dist,,scrabble$freq)

