标签:设置 bsp 文件的 log 应用 读取文件 函数 setw where
字符串连接函数paste
> paste("Hello","world") [1] "Hello world"
> paste("A", 1:6, sep = "") [1] "A1" "A2" "A3" "A4" "A5" "A6"
> paste(letters[1:6],collapse=",") [1] "a,b,c,d,e,f"
> paste("A", 1:6, sep = "", collapse=",") [1] "A1,A2,A3,A4,A5,A6"
> paste(letters[1:4], seq=‘_‘) [1] "a _" "b _" "c _" "d _"
> path <- ‘E:\\mytestdata\\‘ > setwd(path) > dir.data <- dir(path) > dir.data [1] "a.csv" "b.csv" "c.csv" "d.csv" >for(i in 1:length(dir.data)){ >data <- read.csv(paste(path,dir.data[i],sep=‘‘)) >}
write.csv(a.csv,file=paste(path,‘data.csv‘))
paste(‘select * from student where date =‘,‘date‘,sep=" ")
> date1 <- 20150101 > date2 <- 20151231 > paste0("select * from sales where stat_date between ",date1," and ",date2) [1] "select * from sales where stat_date between 20150101 and 20151231"
标签:设置 bsp 文件的 log 应用 读取文件 函数 setw where
原文地址:http://www.cnblogs.com/freescience/p/7420870.html