# Create a temporary directory for mock CSV files
tmp_dir <- tempdir()
# Define file paths
tmp1 <- file.path(tmp_dir, "file1.csv")
tmp2 <- file.path(tmp_dir, "file2.csv")
# Write two mock CSV files in the temporary folder
write.csv(data.frame(ID = c("A", "B", "C"), val = c(1, 2, 3)), tmp1, row.names = FALSE)
write.csv(data.frame(ID = c("A", "B", "C"), val = c(4, 5, 6)), tmp2, row.names = FALSE)
# Merge the CSV files in the temporary folder, normalize with z-score, and return transposed
result <- combineSpectra(
folder = tmp_dir,
file_type = "csv",
sep = ",",
common_col_pos = 1,
data_col_pos = 2,
normalization = "z-score",
orientation = "rows"
)
Run the code above in your browser using DataLab