My data frame contains five character columns and one numeric column. When I export the data frame all columns convert to strings including the numeric column. How do I avoid this?
The structure of my data frame:
Classes ‘tbl_df’, ‘tbl’ and 'data.frame': 3194 obs. of 6 variables:
$ State_FIPS_Code : chr "00" "01" "01" "01" ...
$ County_FIPS_Code : chr "000" "000" "001" "003" ...
$ Postal_Code : chr "US" "AL" "AL" "AL" ...
$ Name : chr "United States" "Alabama" "Autauga County" "Baldwin County" ...
$ Poverty_Percent_All_Ages: num 14.7 18.5 12.7 12.9 32 22.2 14.7 39.6 25.8 20 ...
$ geoid : chr "00000" "01000" "01001" "01003" ...
Export code:
write.csv(dfGeoid, file = "MyData.csv", row.names=T)