r - R中的游泳者生存图
问题描述
这是我从datapasta获得的数据集:
data.frame(stringsAsFactors = FALSE,patient_ID = c("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"),Time = c(1596,1514,356,2085,1921,318,83,328,815,1854,159,240,821,720,2315,1800,99,205,177)
我正在尝试获取此数据的游泳者图。我输入了以下内容:
H_N_outcomes_first20$Time <- as.numeric(H_N_outcomes_first20$Time)
H_N_outcomes_first20$patient_ID <- as.character(H_N_outcomes_first20$patient_ID)
library(swimplot)
swimmer_plot(df=H_N_outcomes_first20, id="patient_ID", end= "Time", fill='lightblue', width=0.85)
我收到以下错误消息:
Error in model.frame.default(formula = df[, end] ~ df[, id]) :invalid type (list) for variable 'df[, end]'
https://cran.r-project.org/web/packages/swimplot/swimplot.pdf
解决方案
推荐阅读
- java - 关于 JAVA 中的连接池:我需要消耗服务器响应吗?如果不 ?池化如何工作
- python - 同时显示所有验证错误,Django Rest Framework中的错误累积
- c# - 无法使用 Microsoft Graph api graphServiceClient.Users.Request() C# 感染所有用户详细信息
- excel - 基于日期锁定列
- python - 指示的列表必须是整数或切片而不是元组
- javascript - 遍历 JSON 中的对象
- python - pandas 按日期和值比较某些列条目
- javascript - 使用 Cytoscape 限制放置区域
- java - Spring MVC - 在 POJO 中使用连字符查询参数
- selenium - Selenium navigate().to() 卡住没有错误