I have a dataframe that looks like this:
var1 var2 var3 year value
AT EA 1 02 ...
AT EA 1 03 ...
AT XY 2 02 ...
AT XY 2 03 ...
BE EA 1 02 ...
BE EA 1 03 ...
BE XY 2 02 ...
BE XY 2 03 ...
Value is just a numeric variable. What I want to do is produce a graphic which shows value in the y axis and year in the x axis. Furthermore, I want:
one plot for each level of var1 (that would be the factor condition in xyplot)
each level of var2 should have a different color
each level of var3 should be a different type of line graph (continuous vs. dashed)
Also, can I tell R to just use certain levels of var1 and var2 to make to graph? E.g. only use those observations where var1 is "AT" or "FR", but not those where it is "BE" or "DE"? Var1 and var2 both have 13 levels in the data.frame.
Edit: The data.frame can be downloaded here. I tried the following:
library(lattice)
xyplot(value~year | factor(report_ctry), data=EA17_flows_ex, groups=factor(indicator), type="l")