求助高手:
R shiny中如何设定动态文本路径?
function(input,output,session){
spcfile<-eventReactive(input$get,{
setwd(input$path)----利用textInput文本空间,动态设置路径
file_list=list.files(input$path)
spc<-c()
for (batch in file_list){
#print(batch)
spc01=data.frame(read.csv(batch,header=FALSE,blank.lines.skip=FALSE,fill=TRUE,skip=1,col.names = (1:26),stringsAsFactors=FALSE))
spc <- rbind(spc, spc01)
}
names(spc)<-c("CUSTOMER_LOT_ID","LOT","PRODUCT","FAB","STATION","CONTROLITEM_ID","MEASURE_TIME","OPERATOR","SPECGROUP_ID",
"USL","SL","LSL","CONTROLGROUP_ID","X1","X2","X3","X4","X5","X6","X7","X8","X9","X10","X11","X12","X13")
spc%>%filter(is.na(X1)==FALSE)->spc
spc<-spc[,-26]
})