复制
收藏
提问
全网

Km_plot <- function(tumor = "GBM", + measure = "OS", + best_cutoff = TRUE, + cutpoint = 50, + legend_pos = "right"){ + sss_can <- sss[【tumor】] %>% dplyr::select(c("sample","values",measure,paste0(measure, ".time"))) 错误: unexpected input 于 " legend_pos = "right"){ sss_can <- sss[【"

7f278103a
4个月前
全网
文档
学术
百科
知识库
时间不限
自动

理解问题Km_plot <- function(tumor = "GBM", + measure = "OS", + best_cutoff = TRUE, + cutpoint = 50, + legend_pos = "right"){ + sss_can <- sss[【tumor】] %>% dplyr::select(c("sample","values",measure,paste0(measure, ".time"))) 错误: unexpected input 于 " legend_pos = "right"){ sss_can <- sss[【"

已完成理解Km_plot <- function(tumor = "GBM", + measure = "OS", + best_cutoff = TRUE, + cutpoint = 50, + legend_pos = "right"){ + sss_can <- sss[【tumor】] %>% dplyr::select(c("sample","values",measure,paste0(measure, ".time"))) 错误: unexpected input 于 " legend_pos = "right"){ sss_can <- sss[【"

展开阅读网页

1. 函数定义错误:在R语言中,函数定义时使用<-进行赋值,但您的代码中Km_plot函数定义存在语法错误。

2. 错误的符号使用:代码中的【tumor】【"符号不是有效的R语言代码,应使用英文的方括号[]和双引号"

3. 正确的函数定义:应将Km_plot <- function(tumor = "GBM", ...中的【tumor】替换为tumor,并且去掉【""】

修正后的函数定义如下:

Km_plot <- function(tumor = "GBM",
                     measure = "OS",
                     best_cutoff = TRUE,
                     cutpoint = 50,
                     legend_pos = "right"){
  sss_can <- sss[tumor] %>% dplyr::select(c("sample", "values", measure, paste0(measure, ".time")))
  # 其他代码...
}

请注意,上述代码仅修正了函数定义部分的错误,实际使用时还需要根据具体需求完成函数的其余部分。46

更专业一些
转笔记
专业
Km_plot <- function(tumor = "GBM", + measure = "OS", + best_cutoff = TRUE, + cutpoint = 50, + legend_pos = "right"){ + sss_can <- sss[【tumor】] %>% dplyr::select(c("sample","values",measure,paste0(measure, ".time"))) 错误: unexpected input 于 " legend_pos = "right"){ sss_can <- sss[【"
不在提醒

更专业内容正在努力生成中
知识树
Km_plot <- function(tumor = "GBM", + measure = "OS", + best_cutoff = TRUE, + cutpoint = 50, + legend_pos = "right"){ + sss_can <- sss[【tumor】] %>% dplyr::select(c("sample","values",measure,paste0(measure, ".time"))) 错误: unexpected input 于 " legend_pos = "right"){ sss_can <- sss[【"
如何解决R语言中的语法错误?
R语言中dplyr包的使用方法
如何在R中使用管道操作符?
在线客服