Q:

Create a grouped plot by more than one factor

I'm currently investigating the advantages of dplyr and ggplot.  In one of my plots I have a data.frame containing two factors, namely F1 and F2.  I wanted to create a line plot for each possible combinations of F1 and F2 (Cartesian product, here 4=2 x 2 outcomes).  
It seems, that ggplot only accepts one factor here F1.  So that the lines in my plots are connected, whereas I expect four separate lines. 
library(dplyr)
library(ggplot2)

df<-data.frame("X"=c(1,2,4,5,7,8,10,11),"Y"=c(1,2,3,4,5,6,7,8),"F1"=c(1,1,1,1,2,2,2,2),"F2"=c(1,1,2,2,1,1,2,2))
df$F1<-as.factor(df$F1)
df$F2<-as.factor(df$F2)
ggplot(df, aes(x=X, y=Y, group=F1, color=F2))+geom_line()

A workaround might be to add a new column to my dataframe combining F1 and F2, but I have no idea how to do this. 

A:

You're right that you can only specify one factor to control the grouping.  If you want to use more than one, you can use the interaction function to work out the combination:
# you can either calculate the interaction beforehand and supply that...
df$F1F2 <- interaction(df$F1, df$F2)
ggplot(df, aes(x = X, y = Y, group = F1F2, color = F1F2)) + geom_line()

# or you can just drop it straight in! 
ggplot(df,
  aes(x = X, y = Y, group = interaction(F1, F2), color = interaction(F1, F2))) +
  geom_line()

You can also use the arguments to interaction to control how it's formatted (for plot presentation). 
Alternatively, you can find other ways to visualise multiple factors.  For example, you might use one factor for grouping, and then use facetting to display levels of another factor (or two more, in fact).