The car is obviously too close to you. I do agree with what others have said that you were trying to ride too close to the edge, giving drivers the opportunity to buzz you. If it feels dangerous, then it usually is, so take the lane and whenever possible (road permitting), let the drivers pass.