[EpiData-list] Reading the new XML files into R

epidata-list at lists.umanitoba.ca epidata-list at lists.umanitoba.ca
Sat Jun 11 10:53:25 CDT 2011


David,


> read.epidata.xml() returns a list of dataframes. To use other R functions
> like summary() you just need to get/use the dataframe from the list using
> double square brackets to extract an element from a list, i.e. [[]]. There
> is only one dataframe in the list, so it will be the first one, so we use
> [[1]]:
>
> x <- read.epidata.xml("test.epx", dec.sep = ".")[[1]]
> x
> summary(x)
> table(x$Species)
> barplot(table(x$Species))
> etc.
>
> BTW, the field st comes from epidata, I don't know what it is for, I
> haven't checked the docs yet.


Thanks again, I did see the commented out bit of code but didn't grasp the
relevance of it.

All looking good so far, and I am learning new things so many thanks.

Graham


More information about the EpiData-list mailing list