I'm importing a folder of files according to the package eemR using the following:
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)
However, when I import the files, they are simply just called [[1]], [[2]].. and so on - Is there a way to make it so the files retain their names when I import them? i.e., one is called Raman520, and I would like it to be called that when it's imported as an eem (in the final line of the above code).
My eventual goal is to automate some functions within the eemR package, but I'm assuming I can still do that even if I let the files keep their names.
Thanks