Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
たとえば、ベクトルがありますtest<-c("red","blue","green")。ベクトルの要素を1つに結合するにはどうすればよいので、test<-c("red/blue/green").
test<-c("red","blue","green")
test<-c("red/blue/green")
使用できることはわかっていますpaste(test[1],test[2],test[3], sep="/")が、私のベクターには何百もの要素があるため、それは大変な作業です!
paste(test[1],test[2],test[3], sep="/")
あなたの助けをthx!
collapseのパラメータを使用できますpaste
collapse
paste
> paste(test , collapse ="/") [1] "red/blue/green"