ConvertToList: Convert to list

Description Usage Arguments Details Value Author(s) Examples

View source: R/ConvertToList.R

Description

Function for data conversion

Usage

1
ConvertToList(countrydat)

Arguments

countrydat

input data

Details

Okay

Value

list

Author(s)

E. A. Pena

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (countrydat) 
{
    nrows = dim(countrydat)[1]
    seqrev = nrows:1
    dat = NULL
    dat$code = countrydat[1, 9]
    dat$id = countrydat[1, 8]
    dat$name = countrydat[1, 7]
    dat$popn = countrydat[1, 10]
    dat$dayNum = 1:nrows
    dat$dateRep = countrydat[seqrev, 1]
    dat$day = countrydat[seqrev, 2]
    dat$month = countrydat[seqrev, 3]
    dat$year = countrydat[seqrev, 4]
    dat$cases = countrydat[seqrev, 5]
    dat$deaths = countrydat[seqrev, 6]
    dat$cumcases = PartialSum(dat$cases)
    dat$cumdeaths = PartialSum(dat$deaths)
    return(dat)
  }

fblues/Test documentation built on June 27, 2020, 12:18 a.m.