Error in Math.factor() : ‘sqrt’ not meaningful for factors

Posted Data+Science+Insight

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Error in Math.factor() : ‘sqrt’ not meaningful for factors相关的知识,希望对你有一定的参考价值。

Error in Math.factor() : ‘sqrt’ not meaningful for factors

目录

Error in Math.factor() : ‘sqrt’ not meaningful for factors

问题:

解决:

完整错误


问题:

x5 <- factor(10)                               
# Create factor object

#
sqrt(x5)                                       
# Apply sqrt to factor

解决:

#正确的玩法
x5_sqrt <- sqrt(as.numeric(as.character(x5)))  
# as.numeric, as.character & sqrt
x5_sqrt                                        
# Return output to RStudio console
# 3.162278

完整错误

> #
> sqrt(x5)                                       
Error in Math.factor(x5) : ‘sqrt’ not meaningful for factors
> # Apply sqrt to factor

以上是关于Error in Math.factor() : ‘sqrt’ not meaningful for factors的主要内容,如果未能解决你的问题,请参考以下文章

[RxJS] Error Handling in RxJS

# Error in colSums(iris) : ‘x‘ must be numeric,# Error in rowSums(iris) : ‘x‘ must be numeric

1064 - syntax error, error in :'Id`) USING BTREE

ERROR 1064 (42000): You have an error in your SQL syntax...

Error in eval(family$initialize) : y值必需满足0 <= y <= 1Error in eval(family$initialize) : y values mus

Parse error: syntax error, unexpected '(' in