我有以下脚本:
Files <- list.files(datapath, pattern = ".txt")
# convert all .txt files in the given folder
for (i in 1:length(Files)){
dataname <- Files[i]
filename <- paste(datapath, dataname, sep="")
read_eprime(filename) %>% FrameList() %>% to_data_frame() %>% select(Cue:ISIslide.RT, GetReady.OnsetTime, ScanWait.OffsetTime) %>% slice (-1) %>%
fill(GetReady.OnsetTime, .direction = "up") %>% fill(ScanWait.OffsetTime, .direction = "up") %>% slice (-79) -> edf
write.csv(edf, file = paste0(datapath, dataname, "_P.csv"), na = "", row.names = FALSE)
#write.csv(edf, file=paste0(datapath, "tsv_", dataname), quote=FALSE, sep="\t", na = "")
}
如何调整它,使输出文件不保存名称中间的“.txt”?