Using Windows 10, R 4.0.3 and RStudio 1.4.1103
I have a script (written by a developer), the output of which is a kind of a tree diagram in txt. The piece of code is:
for (index in seq_len(nrow(file))) {
write(paste0(path, if (index == nrow(file)) '└' else '├' , '──', file[index, 'name']), tree_filename, append = TRUE)
newPath = if (index == nrow(file)) paste0(path, ' ') else paste0(path, '│ ')
treefunction(file[index, id_column_header], newPath)}
The characters │ and └ appear correctly in RStudio when typed into the code. However, when the output of the function is saved in .txt, these characters become +'s and -'s for me, while for the developer all works perfectly (pls see image below with both outputs).
What I have tried so far: I have set utf-8 in .RProfile and the .txt file is encoded in utf-8 (I have checked).
The developer is using linux (I'm not sure which version). Could someone please help with what I should do so the └ type characters display as they should? Thank you very much.
