I'm trying to write out a .csv file.
readr::write_csv
seems to think that my file isn't a data.frame
.
When I run:
PriceCostRaw <- write_csv(PriceCostRaw, "Price Cost Raw.csv")
it returns this error:
Error in write_delim(x, path, delim = ",", na = na, append = append,
col_names = col_names) :
is.data.frame(x) is not TRUE
It is in fact a data.frame
:
> str(PriceCostRaw)
Classes ‘tbl_df’, ‘tbl’ and 'data.frame': 192 obs. of 7 variables:
> is.data.frame(PriceCostRaw)
[1] TRUE
utils::write.csv
seems to work just fine.
Why is this happening with write_csv
? Are there other tests I can check for to make sure something weird is going on with my data file or variable structures?
I can't post the data itself because it's proprietary.