The use of an index of similarity to measure the flows of R&D at firm level