此strsplit代码中[[1]]的意义是什么

时间:2019-08-12 14:10:22

标签: r sapply strsplit

无法理解此代码中对[[1]]的需要。删除它会显示错误。

first_and_last <- function(x){letter <- strsplit(x, split = "")[[1]  return(c(first = min(letter), last = max(letter)))}
  

错误说:min(字母)中的错误:参数的'typr'(列表)无效

0 个答案:

没有答案
相关问题