如何找到多列的偏度并单独打印数据框的偏度因子
how to find the skewness of multiple columns and individually print the skew factor of a dataframe
如何通过编写 skewness() multiple no.次
而不是使用循环或其他东西我可以找到偏度
我尝试使用 R
实现这个
for(i in length(numeric_val)) #numeric_val is a dataframe containing 38 cols and 1460 rows
{
if(skewness(as.numeric(unlist(numeric_val[i]))) > 0.75)
{
numeric_val[i] = log1p(numeric_val[i])
}
}
请任何人帮助我。
可能是这样的:
sapply(df, function(x) ifelse(skewness(x) > 0.75, x <- log1p(x), x))
如何通过编写 skewness() multiple no.次 而不是使用循环或其他东西我可以找到偏度 我尝试使用 R
实现这个for(i in length(numeric_val)) #numeric_val is a dataframe containing 38 cols and 1460 rows
{
if(skewness(as.numeric(unlist(numeric_val[i]))) > 0.75)
{
numeric_val[i] = log1p(numeric_val[i])
}
}
请任何人帮助我。
可能是这样的:
sapply(df, function(x) ifelse(skewness(x) > 0.75, x <- log1p(x), x))