Why i am getting an error - that x must be numeric, when my df3 has no non-numeric data. Attached image.
My code is -
df3 <- tibble::add_column(df2, Liking = c("3.85", "5.13", "6.00", "5.73",
"4.91", "5.01", "5.77", "5.35",
"4.39", "5.57", "4.99", "5.94"),
.after = "Cauliflower")
quanti.sup <- df3[1:12, 22, drop = FALSE]
head(quanti.sup)
quanti.coord <- cor(quanti.sup, res.pca$x)
quanti.cos2 <- quanti.coord^2
Liking is non numeric. You are using double quotes sonyou are making chars
@nirgrahamuk, What do you mean, double quotes makes it non-numeric? So how I should make it numeric?
var_a <- 123
var_b <- "123"
class(var_a)
class(var_b)
df3 <- tibble::add_column(df2, Liking = c(3.85, 5.13, 6.00, 5.73,
4.91, 5.01, 5.77, 5.35,
4.39, 5.57, 4.99, 5.94),
.after = "Cauliflower")
1 Like
system
Closed
5
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.