2021年4月22日星期四

How do I export a number inside parenthesis to csv without excel displaying negative number?

I'm writing a new function in R that tries to export coefficient estimates to a csv file. I have a dataframe (df) that is something like (coefficient, se, observation). I'm using:

write.table(df, filename, row.names = FALSE, sep=",")  

The code runs perfectly fine; however, when I open my csv, my SE will be -0.02 because excel thinks my (0.02) is -0.02. Is there any way to prevent this?

https://stackoverflow.com/questions/67222490/how-do-i-export-a-number-inside-parenthesis-to-csv-without-excel-displaying-nega April 23, 2021 at 08:33AM

没有评论:

发表评论