【发布时间】:2021-08-12 22:08:02
【问题描述】:
我正在根据包 eemR 使用以下内容导入文件文件夹:
library(data.table)
library(tidyverse)
library(eemR)
importIlliter <- function(file) {
fluoroFrame <- fread(file) %>% as.data.frame()
return(
list(
file = file,
x = fluoroFrame[ -1, -1] %>% t() %>% as.matrix() %>% unname(),
ex = fluoroFrame[ -1, 1] %>% as.numeric(),
em = fluoroFrame[ 1, -1] %>% as.numeric()
)
)
}
folder <- file.path("C:/Users/ejs7c/OneDrive/Desktop/eemR/")
eems <- eem_read(folder, recursive = TRUE, import_function = importIlliter)
但是,当我导入文件时,它们只是简单地称为 [[1]]、[[2]].. 等等 - 有没有办法让它在我导入文件时保留它们的名称?即,一个叫做 Raman520,我希望它在作为 eem 导入时被调用(在上述代码的最后一行)。
我的最终目标是自动化 eemR 包中的一些功能,但我假设我仍然可以做到这一点,即使我让文件保留它们的名称。
谢谢
【问题讨论】: