readData            package:surveillance            R Documentation

_R_e_a_d_i_n_g _o_f _D_i_s_e_a_s_e _D_a_t_a

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

     Reading of disease data. In the package disease data are saved in
     a file '<abb>.txt' containing three columns - the weeknumber
     (week), the observed number of counts (observed) and a state
     (state). The data are read using 'read.table(...,header=T)', hence
     the file has to contain a header.

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

         readData(abb,week53to52=TRUE,sysPath=TRUE)

_A_r_g_u_m_e_n_t_s:

     abb: abbreviation of the diseasename.

week53to52: Boolean indicating whether to convert RKI 53 Weeks System
          to 52 weeks a year

 sysPath: Boolean, if 'TRUE' then R automatically looks in the data
          directory of the surveillance package.

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

     This function is only kept for backwards compability. As of 0.9-2
     all data should be read with 'data'.

_V_a_l_u_e:

 disProg: a object 'disProg' (disease progress) including a list of the
          observed and the state chain.

_S_e_e _A_l_s_o:

     'm1', 'm2', 'm3', 'm4', 'm5', 'q1_nrwh', 'q2', 's1', 's2', 's3',
     'k1', 'n1', 'n2', 'h1_nrwrp'

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

         readData("m5")

         #To bring a single vector of counts into a format, which can be
         #handled by readData. Assume ``counts'' is a vector of counts.
         counts <- rpois(100,20)
         counts <- data.frame("week"=1:length(counts),"observed"=counts,
                              "state"=rep(0,length(counts)))
         write(c("week","observed","state"),file="disease.txt",ncol=3)
         write(t(as.matrix(counts)),file="disease.txt",ncol=3,append=TRUE)
         disease <- readData("disease",week53to52=FALSE,sysPath=FALSE)

