Error in[[i]], optional = TRUE) : cannot coerce class ‘"by"’ to a data.frame

I want to create a K-M curve about bladder cancer by the metastasis of different organs.
First,I successfully create the K-M curve between two group——’metastasis‘ and ’Non-metastasis.However,when I want to investigate the relationship between the exact organ metastasis and overall survival,the R reporting'
error in[[i]], optional = TRUE) : **
**** cannot coerce class ‘"by"’ to a data.frame
I have searched the internet all night,but I could not find the answers,could you help me ,thank you


ggsurvplot(fit, # 创建的拟合对象
          data = seer_DM,  # 指定变量数据来源
 = TRUE, # 显示置信区间
          pval = TRUE, # 添加P值
          xlab = "Survival months", # 指定x轴标签
          legend.labs = c( "Non-metastasis","Metastasis"),
          legend = c(0.8,0.9), # 指定图例位置
          legend.title = "", # 设置图例标题
          # 指定图例分组标签
 = 100)  # 设置x轴刻度间距```

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.