page
whose number of rows changes regularly, I wrote this code so that it fits the number of rows that my page$id
has and I wrote this while
so that it will generate a "g_com[numero]"
for each of these lines.
meu page$id contém:
[1] "1793398447353793"
[2] "1792916894068615"
[3] "1792013524158952"
[4] "1791520780874893"
continua...
This is the script I'm running:
binds <- as.data.frame(page$id)
contador <- 1
while (contador <= length(page$id)) {
binds[contador] <- paste0 ("g_com", contador)
contador <- contador + 1
}
b <- binds [1,]
It is returning a table with 17 columns and a row in each:
> print(binds)
page$id V2 V3 V4 V5
1 g_com1, g_com2, g_com3, g_com4, g_com5,
However, I need to automatically group all these "g_com"
into a sentence, so that it runs out of the comma after the last element and can be displayed on a single line, not columns, I need to run a rbind on them, so I need it to return something like
g_com1, g_com2, g_com3, ..., g_com17
If someone can help me, I appreciate it.