You want on
rather than where
in the last sql statement. With where
it is performing the join and then afterwards applies the where
clause whereas with on
it does the join relative to the on
condition.
> sqldf('select matr.*, one.* from matr left outer join one on one.c1 = matr.c1')
c1 c2 c1 c2
1 a 1 a 1
2 a 1 a 1
3 a 0 a 1
4 b 1 b 1
5 b 1 b 1
6 b 0 b 1
7 b 1 b 1
8 c 0 <NA> <NA>
9 c 0 <NA> <NA>