Description Usage Arguments Details Value Author(s) Examples
View source: R/ConvertToList.R
Function for data conversion
1 | ConvertToList(countrydat)
|
countrydat |
input data |
Okay
list
E. A. Pena
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)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.