Error in sumx invalid type character of argumentCalled from FUNnewX i
This error occurs when you try to apply a mathematical function on a character vector instead of a numerical vector. In this case, the function "sum()" is being applied on a character vector "x" which is not a valid type for the "sum()" function.
To resolve this error, you need to convert the character vector into a numerical vector using the "as.numeric()" function. For example:
x <- c("1", "2", "3") sum(as.numeric(x))
This will convert the character vector "x" into a numerical vector and then apply the "sum()" function on it, giving the correct result
原文地址: https://www.cveoy.top/t/topic/eq9B 著作权归作者所有。请勿转载和采集!