elasticband               package:DAAG               R Documentation

_E_l_a_s_t_i_c _B_a_n_d _D_a_t_a

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

     The 'elasticband' data frame has 7 rows and 2 columns giving, for
     each amount by which an elastic band is stretched over the end of
     a ruler, the distance that the band traveled when released.

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

     elasticband

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

     This data frame contains the following columns:

     _s_t_r_e_t_c_h the amount by which the elastic band was stretched

     _d_i_s_t_a_n_c_e the distance traveled

_S_o_u_r_c_e:

     J. H. Maindonald

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

     print("Example 1.8.1")

     attach(elasticband)     # R now knows where to find stretch and distance
     plot(stretch, distance) # Alternative: plot(distance ~ stretch)
     detach(elasticband)
     pause()

     print("Output of Data Frames - Example 12.3.2")

     write(t(elasticband),file="bands.txt",ncol=2)

     sink("bands2.txt")
     elasticband   # NB: No output on screen
     sink()

     print("Lists - Example 12.7")

     elastic.lm <- lm(distance ~ stretch, data=elasticband)
      names(elastic.lm)
      elastic.lm$coefficients
     elastic.lm[["coefficients"]]
     pause()

     elastic.lm[[1]]
     pause()

     elastic.lm[1]
     pause()

     options(digits=3)
     elastic.lm$residuals 
     pause()

     elastic.lm$call
     pause()

      mode(elastic.lm$call)

