0

So, I am saving my dataframe as a .txt by using this code:

write.table(FinalLongFormat, file = "../data/FinalLongFormattxt", 
            sep = "\t", dec = ".", row.names = F, col.names = T)

My dataframe is looking perfectly fine inside Rstudio, but all the values from my last three columns are missing when I save it as a .txt file. I attached a picture to show what it looks like:

picture of txt.file

Hopefully someone here is familiar with his problem:)

r2evans
  • 141,215
  • 6
  • 77
  • 149
Sverdo
  • 15
  • 4
  • Your output is tab-delimited, but it sounds like you want fixed-width format. If that's the case, perhaps https://stackoverflow.com/q/54751514/3358272 will help. (In addition, the `gdata` package has `write.fwf`, I believe, which might be suitable for you as well.) – r2evans Sep 05 '21 at 21:11
  • Please provide enough code so others can better understand or reproduce the problem. – Community Sep 05 '21 at 22:33

1 Answers1

0

All 11 columns are there (in your image), they just aren't aligned with the column headers.

walter
  • 518
  • 3
  • 8