juba / rainette

R implementation of the Reinert text clustering method
https://juba.github.io/rainette/
53 stars 7 forks source link

How to import txt data from txt file #1

Closed wilcar closed 4 years ago

wilcar commented 4 years ago

Hi, thank you for your great job. I am dealing with .txt files (with **** on top and bottom for Iramuteq)

image

   # example of readling text files : 
     fichier <- readLines("testfinal.tx")

According to your vignette :

     corpus <- import_corpus_iramuteq(fichier)

return me this error :

   Error in file(f, ...) : invalid 'description' argument

Can you help me ?

juba commented 4 years ago

Hi,

The first argument to import_corpus_iramuteq should be a connection or filename, not the result of readLines. So maybe the following would work :

corpus <- import_corpus_iramuteq("testfinal.txt")

Let me know if it doesn't...

juba commented 4 years ago

Je passe en français du coup :-)

Vu l'aperçu de votre fichier texte, je ne suis pas sûr que l'importer tel quel donnera de bons résultats. Vous avez du "vrai texte" à un moment donné ou ce ne sont que des champs avec des valeurs comme "Langue", "Format", "Identifiant", etc. ?

wilcar commented 4 years ago

Bonjour, c'est un vrai texte et cela fonctionne. Merci pour votre aide.