Dear R gurus.
I have a data file which has two rows of variable names.
And the time index has a little unusual format. I have no idea
how to handle two names and awkward indexing for the quarters.
Lines <- "
Index; UK; UK; JP; JP
Index; a1; a2; a1; a2
2009 2/4;2;4;3;2
2009 3/4;5;2;1;4
2009 4/4;7;1;1;6
2010 1/4;3;3;5;2
2010 2/4;5;1;2;1
"
(a snippet from a big data containing a1, a2, ..., a10 of many countries)
I want to sum a1 and a2 for UK, JP and obtain a zoo object like this:
A B
2009 Q2 6 5
2009 Q3 7 5
2009 Q4 8 7
2010 Q1 6 7
2010 Q2 6 3
This looks quite challenging. Thanks for your time.
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.