I am trying to create a correlation panel using only specific rows. I am using the native R dataframe "iris" and want to create three correlation panels that relate only to particular species. This is my code:
library(psych)
pairs.panels(iris[iris$Species == "setosa",], lm=TRUE)
pairs.panels(iris[iris$Species == "versicolor",], lm=TRUE)
pairs.panels(iris[iris$Species == "virginica",], lm=TRUE)
Although I am getting a correlation panel for each specie separately, I keep getting this error:
Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : 'a' and 'b' must be finite
This is the error that appears on the correlation panel output (pls see link): error on panel
I already tried creating different dataframes that only contain the specific rows that I want. For example:
setosa <- iris[iris$Species == "setosa",]
pairs.panels(setosa, lm=TRUE)
But I still get the same error.
Would appreciate any help to try and get rid of the error.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.