Skip to content
This repository has been archived by the owner on May 4, 2019. It is now read-only.

Stop leaking details about the implementation of PDA's #52

Merged
merged 1 commit into from
Jan 7, 2014

Conversation

johnmyleswhite
Copy link
Member

This removes three functions we should probably never have created:

  • get_indices
  • index_to_level
  • level_to_index

Users should not be accessing our internal representation of PDA's as part of their normal workflow. The R documentation voices its wish that users wouldn't do this, but then concedes that it happens all the time. We should not let that happen to Julia.

No more get_indices
No more index_to_level
No more level_to_index
@johnmyleswhite
Copy link
Member Author

Is anyone opposed to this? It seems like such a clear improvement to me that I'll just go ahead and merge it soon in the absence of objections.

@nalimilan
Copy link
Member

Sure.

I can remember a few cases where I used a factor in R to represent categories which I considered linearly spaced (e.g. diplomas), and which in some cases I wanted to transform into an integer variable. But I think that's a corner case, and to do that you do not need access to the actual implementation (i.e. you can create your own integer values with 1:length(levels(pda)).

johnmyleswhite added a commit that referenced this pull request Jan 7, 2014
Stop leaking details about the implementation of PDA's
@johnmyleswhite johnmyleswhite merged commit f5cdb8d into master Jan 7, 2014
@johnmyleswhite johnmyleswhite deleted the jmw/stopleaks branch January 7, 2014 15:18
@johnmyleswhite
Copy link
Member Author

Totally agree that there are cases in which you want a mapping from categories to integers. We can make a function that constructs such a mapping for users.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants