I created a table where I have a list of town names in rows and company names in headers. The number of times a company operated in a town is shown where the town and company intersect. I am trying to take the sum of the number of times all companies operated in the town through the rowsum function. But am not having luck.
Here is the string of how my data is formatted 'data.frame': 15030 obs. of 3 variables: $ Var1: Factor w/ 167 levels "Andover","Ansonia",..: 1 2 3 4 5 6 7 8 9 10 ... $ Var2: Factor w/ 90 levels "CompanyA","CompanyB",..: 1 1 1 1 1 1 1 1 1 1 ... $ Freq: int 0 0 0 0 1 0 0 0 0 0 ...
Can anyone advise?
أكثر...
Here is the string of how my data is formatted 'data.frame': 15030 obs. of 3 variables: $ Var1: Factor w/ 167 levels "Andover","Ansonia",..: 1 2 3 4 5 6 7 8 9 10 ... $ Var2: Factor w/ 90 levels "CompanyA","CompanyB",..: 1 1 1 1 1 1 1 1 1 1 ... $ Freq: int 0 0 0 0 1 0 0 0 0 0 ...
When I enter the following code: rowsum((RSIP_15Oct02_Form,RSIP_15Oct02_Form$Var1,reorder=TRUE))
this error occurs pops up: Error in rowsum.data.frame(RSIP_15Oct02_Form, group = RSIP_15Oct02_Form$Var1) : non-numeric data frame in rowsum
Can anyone advise?
أكثر...