如何将输入指定为 R 中函数中的唯一数字类?例如,
read_data <- function(file_name, sheet, sample_list = stop("'sample_list' must be provided")){
ibrary(readxl)
data = read_excel(file_name, sheet = 2)
meantritc = sapply(samplelist, function(x)data[grep(x, pattern = data$Source),]$Mean)
names(data) = sample_list
return(data)
}
如果sheetname
根据需要改为提及read.xlsx()
,它应该能够打印一条消息以提供表号插入?