rm(list=ls())
require(R2HTML) library(curl) pathset<-"D:\原电脑文件\Music\Kugou\temp\" setwd('D:\原电脑文件\Music\Kugou\temp\') aus=list.files(pattern=".mp3") mcc=function(x){ mcc1=curl_escape("原电脑文件") mcc2=curl_escape(x) mcc3=paste("",mcc1,"/Music/Kugou/temp/",mcc2,sep="") return(mcc3) } adget_yyg=apply(data.frame(aus),1,mcc) yyg_music=data.frame(adget_yyg) for(i in 1:nrow(yyg_music)){ bf_mus<- as.character(yyg_music[i,1]) htmlmusic=paste("<audio autoplay='autoplay' controls='controls' loop='loop' preload='auto' src='",bf_mus,"'"," > ",sep="") target <- HTMLInitFile("d:/11/",filename=paste("yyg's music",sep=""),BackGroundColor="#raaabb") HTML(htmlmusic,file=target) shell(target) print(i) }