Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functions to read and write 'fhx' objects to CSV or JSON files #119

Closed
brews opened this issue Mar 7, 2018 · 2 comments
Closed

Add functions to read and write 'fhx' objects to CSV or JSON files #119

brews opened this issue Mar 7, 2018 · 2 comments
Assignees
Labels
enhancement New feature or request invalid This doesn't seem right
Milestone

Comments

@brews
Copy link
Member

brews commented Mar 7, 2018

Add functions to read and write 'fhx' objects to CSV or JSON files.

This idea came out of a discussion in #115.

@brews brews added the enhancement New feature or request label Mar 7, 2018
@brews brews added this to the v0.5.0 milestone Jul 25, 2019
@brews brews self-assigned this Jul 25, 2019
@brews
Copy link
Member Author

brews commented Jul 25, 2019

CSV format makes the most sense because R is best with "rectangular" data rather than blob-like data objects.

@brews brews added the invalid This doesn't seem right label Jul 25, 2019
@brews
Copy link
Member Author

brews commented Jul 25, 2019

Now that I think about it. We should already have this in v0.5.0 because of #120 .

Example to write to CSV:

library(burnr)
data(lgr2)

write.csv(lgr2, "lgr2.csv")

and we can read again with:

x <- as.fhx(read.csv("lgr2.csv"))

Tah-dah!

as.fhx() currently discards any cruft rows and only creates an fhx object from the columns it needs so we don't need to worry about saving and reading row.names, here.

Marking as invalid and closing this issue.

@brews brews closed this as completed Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant