I have 3 rows
first <- LETTERS[1:9]
second <- c(1:9)
third <- letters[1:9]
> first
[1] "A" "B" "C" "D" "E" "F" "G" "H" "I"
> second
[1] 1 2 3 4 5 6 7 8 9
> third
[1] "a" "b" "c" "d" "e" "f" "g" "h" "i"
I want the output vector of 9 elements with new line like that
"A "B
1 2
a" b" and so on
I try to use loop but it doesn't work
y <-c()
z <-c()
for(i in 1:length(first)){
y <- paste(first, second, sep = "\n")
z <- paste(y, third, sep = "\n")
}
I got out put
[1] "A\n1\na" "B\n2\nb" "C\n3\nc" "D\n4\nd"
[5] "E\n5\ne" "F\n6\nf" "G\n7\ng" "H\n8\nh"
[9] "I\n9\ni"
This is not give me a newline. The format of my colnames(data) for report need to be like that. Thanks for advance.