R: Error in FUN(X[[i]], …) : only defined on a data frame with all numeric variables
问题 I am working with the R programming language. I am trying to plot some categorical and continuous data that I am working with, but I am getting an error that tells me that such plots are only possible with "only numeric variables". library(survival) library(ggplot2) data(lung) data = lung data$sex = as.factor(data$sex) data$status = as.factor(data$status) data$ph.ecog = as.factor(data$ph.ecog) str(data) #plot mycolours <- rainbow(length(unique(data$sex)), end = 0.6) # png("gally.png", 500,