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

DataFrame(read_from_sas) method that converts data loaded with SASLib.read #18

Closed
xiaodaigh opened this issue Jan 8, 2018 · 3 comments
Labels

Comments

@xiaodaigh
Copy link
Contributor

Currently conversion to DataFrame requires DataFrame(read_from_sas[:data]). Overload the DataFrame method so that DataFrame(read_from_sas) automatically converts feels more Julian.

Also can default to convert in the same column order e.g. define a new Type that is <: Dict{Symbol,Any} and call it the SASInput or something so it dispatch on the following

DataFrame(x::SASInput, colstable = true) = colstable ? DataFrame((c => x[:data][c]) for c in x[:column_symbols])...) : DataFrame(x[:data]);

@tk3369
Copy link
Owner

tk3369 commented Jan 8, 2018

I think integration with StatFiles.jl as proposed by @davidanthoff makes more sense. See comments from #2.

@davidanthoff
Copy link
Contributor

Yeah, I'm really impressed by the work in this repo, and essentially plan to switch StatFiles.jl over to use this package here once things are stable/settled down a bit. At that point DataFrame(load("myfile.sas7bdat") will just work, and the column order will be preserved. And of course it will not just work with DataFrame, but pretty much anything else (JuliaDB etc.).

@tk3369 tk3369 added the on hold label Jan 28, 2018
@tk3369
Copy link
Owner

tk3369 commented Mar 7, 2018

@xiaodaigh The latest version makes the conversion to DataFrame a lot easier by using a standard two-argument constructor. Column orders are also preserved. I don't want to build yet another package dependency just for this so I'll leave it this way.

Closing this issue.

@tk3369 tk3369 closed this as completed Mar 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants