Double loop to create a dataframe

Hello !
I am a newbie on R and i am face a problem that i hope someone here can help me ^^

I have several .txt document whose i want to study

I import and create several data frame for each document

folder <- "/Users/sylvain/Desktop/php/linking-interne-semantique/"      # path to folder that holds multiple .csv files
files_names3 <- list.files(path="/Users/sylvain/Desktop/php/linking-interne-semantique", pattern="*.txt")

for (i in 1:length(files_names3)){
  assign(files_names3[i],
         read.delim(files_names3[i])
  )}

I have in total, 33 documents, now i want to create a data frame, which each document will be compare each other.

Example : i have, " doc1.txt ", " doc2.txt ", "doc3.txt"

i need a result similar to :
doc1.txt doc1.txt
doc1.txt doc2.txt
doc1.txt doc3.txt
doc2.txt doc1.txt
doc2.txt doc2.txt
doc2.txt doc3.txt
doc3.txt doc1.txt
doc3.txt doc2.txt
doc3.txt doc3.txt

I have this code :

for (i in 1:length(files_names3)) {
  for (j in 1:length(files_names3)) {
   print(paste(files_names3[i],files_names3[j],sep=","))
  }
}

When i print, it works, but i dont know how to set the whole resultat to a dataframe

Any help ? :slight_smile:

Thx !!!!