我正在尝试编写一个相当简单的代码,它给了我上面的错误消息。 暴露天数数据看起来像
groupid Quarter ExposedDays AboveMaxDays PatGroup Ageband sex Country
1 1 983 0 A 0 TO 18 F E
1 2 167 10 B 0 TO 18 F I
1 1 435 0 C 0 TO 18 F S
The code is as follows-
y<-ExposedDays%>%
select(ExposedDays,AboveMaxDays,PatGroup,Ageband,sex,Country)%>%
gather("Variable","Value",ExposedDays,AboveMaxDays)%>%
mutate(a=sum(ExposedDays), b=sum(AboveMaxDays))
我检查了我应用mutate函数的列,它们都是数字。