readr : Turn off scientific notation in write_csv

后端 未结 6 2014
谎友^
谎友^ 2021-02-07 02:54

I am using R to process Census data which uses really long numeric GEOIDs to identify the geographies. The issue I am facing is when writing out the processed data using w

6条回答
  •  深忆病人
    2021-02-07 03:21

    I would suggest you use

    write.csv((tbl_df(data.frame(GEOID = seq(from=60150001022000, to=60150001022005, 1)))), "test.csv")
    

    instead of

    write_csv((tbl_df(data.frame(GEOID = seq(from=60150001022000, to=60150001022005, 1)))), "test.csv")
    

    If I open test.csv it opens the file in Excel. Excel turns it into scientific notation. When I right click and open with notepad it looks good and I see the original numbers without scientific notation.

提交回复
热议问题