I would like to write a multiple dataframe "neighbours_dataframe" in a single CSV file :
I use this line to write the multiple dataframe to multiple file :
for(i in 1:vcount(karate)){
write.csv(neighbours_dataframe[[i]], file = as.character(V(karate3)$name[i]),row.names=FALSE)}
if I use this code:
for(i in 1:vcount(karate)){
write.csv(neighbours_dataframe[[i]], file = "karate3.csv",row.names=FALSE)}
this would give me just the last dataframe in the csv file :
I was wondering , How could I have a single CSV file which have all the dataframe in the way that the column header of the first dataframe just written to the csv file and all other data frame copied in a consecutive manner ?
thank you in advance
do.call(rbind, neighbours_dataframe)(assumingneighbours_dataframeis a list of data.frames), then write the result of that to a csv. If they don't all share the same columns, then trydplyr::rbind_all(neighbours_dataframe).append=TRUEand it should work.appendwon't work forwrite.csv- see my comment below.