首页 > 解决方案 > invalid 'type' (character of argument

问题描述

This is my code:

TF.vec <- c(rep("TRUE",10),rep("FALSE",10),rep("TRUE",5)) 
sum(TF.vec)

It gives the following error:

Error in sum(TF.vec) : invalid 'type' (character) of argument

not sure what I am needing to do in order to fix the character problem to get actual sum to equal 15 when sum() is put in

标签: rcharacter

解决方案


推荐阅读