11 Jun
2011
11 Jun
'11
5:53 p.m.
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