我没看到 chart.Correlation 有哪个参数能接受这个 "is.numeric" 值。我理解应该在调用 chart.Correlation 前先把所有内容转成数值型。对于 iris,就是 "Species" 这一列。
这样好像能正常运行。
flowers <- iris # I'd rather leave 'irs" unchanged.
flowers$Species <- as.numeric(flowers$Species)
chart.Correlation(flowers,
histogram = TRUE, method = c("pearson"),
pch = 2)
从英语翻译·查看原文I can't find any parameter of chart.Correlation that takes that "is.numeric" value. My understanding is that everything must become numeric before calling chart.Correlation. For iris, that means "Species".
This looks to run correctly:
flowers <- iris # I'd rather leave 'irs" unchanged.
flowers$Species <- as.numeric(flowers$Species)
chart.Correlation(flowers,
histogram = TRUE, method = c("pearson"),
pch = 2)