Bahi8482
Bahi8482

Reputation: 538

Export into text, problem with html special characters

I am trying to export parts of dataframe in r into .txt file, using rio::export the exported part is a text string that contains some characters as >, ≥ and ", some of these show in the text file as < " or > which is not what I need ( I want them to transfer into the text as greater than or less than, etc...). when I looked these up online, I found these to be "html special characters" but I could not find a solution. I believe it has something to do with the encoding. is there a way to fix that by adding arguments to rio::export or do you suggest using other package?

I am using the code:

rio::export(df, "df.txt")

I also tried the following from this question but still gives the same problem How to save R output data to a text file

cat(df$text, file = "myfile.txt") where df$text is the column that has the items I want to export.

Upvotes: 0

Views: 273

Answers (0)

Related Questions