Show the code of the class method where you are trying to do that.
I think that the problem is that you defined a local vector and assigned to it a matrix of an other object. You have to use the member matrix instead of the local matrix. That is instead of
vector<vector<string> > matrix = r.getMatrix();
you have to write