In R i have a matrix that has several categorical values to it. Indexed size 2sqm, 4 sqm, 6sqm, number of units from 1-3, number of persons from 1-4 and then a column that has a summarized count from all the occurrences.
ex:
Size;Units;Pers;Count
4;3;4;3 # three time this row
2;1;1;2 # two times this row
6;2;2;1 # one times this row
How can i make the last column/vector multyply the rows so that is prints out:
Size;Units;Pers;Count
4;3;4;1
4;3;4;1
4;3;4;1
2;1;1;1
2;1;1;1
6;2;2;1
Either in spreadsheet or in R. This is a assignment for school and i just cannot find the way to make the last vector (which i use as a constant to multiply the first 3 columns and yet still keep one in the last column entry.