I want to output the dataframe as a table with no extension name, but I have problems with it. I found that after removing scientific notation, there are fixed spaces between each column. For example, there may be more than one space for some rows between 4th and 5th columns. However, I want to keep only one space between the columns, rather than fixed locations. Could anyone help me with this problem?
The data and the code are shown below. Thanks.
create a small sample
keep four decimal places in columns V2 and V3
df[,2:3] = format(df[,2:3],nsmall=4)
remove scientific notation
df = format(df, scientific=F)
write the output