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

Extract lookup() to a small "tools" package #165

Closed
krlmlr opened this issue Apr 11, 2014 · 13 comments
Closed

Extract lookup() to a small "tools" package #165

krlmlr opened this issue Apr 11, 2014 · 13 comments

Comments

@krlmlr
Copy link

krlmlr commented Apr 11, 2014

I just installed qdap to use its lookup function, and I was really stunned about the number of packages that are pulled in. I don't do NLP, so I'm not really using many of these packages.

There doesn't really seem to be a good alternative to lookup, cf. http://stackoverflow.com/questions/15303283/how-to-do-vlookup-and-fill-down-like-in-excel-in-r . Would you consider extracting this function (and its associated operators) to a small, dependency-free package? Other candidates would be hash, hms2sec, and generally anything else that is not specific to your domain.

@krlmlr krlmlr changed the title Extract lookup() into a small "tools" package Extract lookup() to a small "tools" package Apr 11, 2014
@trinker
Copy link
Owner

trinker commented Apr 11, 2014

This seems like a reasonable request. It would be after the end of semester. I think I'd figure out a script that builds everything by taking from qdap so there's less maintenance involved if these functions are updated.

May I ask if http://cran.r-project.org/web/packages/hash/hash.pdf would suit your needs?

@krlmlr
Copy link
Author

krlmlr commented Apr 14, 2014

Would you be offering these functions in two packages? Why not Import the "tools" package from qdap? (People will have to load the new package, but this seems to be a minor inconvenience.) Or, if you Depend on the "tools" package, the functions should be still available in the search path.

The hash package is an option, but I like the elegance of the %l% and %l+% operators. Also, from my understanding, lookup does not convert keys to character before performing the lookup, in contrast to hash.

@trinker
Copy link
Owner

trinker commented Apr 14, 2014

The original audience for qdap are people in my field. These people have never touched the command line (generally) and I try to make using qdap as pain free as possible. That means everything that was needed was in one manual (help manual) and everything loaded by default. That's why qdap is a bloated beast of a package.

But I have done what you suggest with qdapDictionaries. Everything can be contained in the qdap vignettes. So this may not be a bad approach. I'd probably do a name like qdapTools which keeps the packages together name wise but the name is less informative for people looking for a lookup type of function.

@trinker
Copy link
Owner

trinker commented Apr 15, 2014

#167 is a connected issue in that I'll address both of these in one fell swoop. Projected time to work through these 2 issues is mid May.

@trinker
Copy link
Owner

trinker commented Apr 19, 2014

I have begun separating these functions into a separate package: https://github.com/trinker/qdapTools

@trinker
Copy link
Owner

trinker commented Apr 22, 2014

This has occurred though not pushed to CRAN yet. A bit oft testing and feedback should occur first.

I'm closing this and if we have more issues could we discuss them at the qdapTools issues page?

@trinker trinker closed this as completed Apr 22, 2014
@trinker
Copy link
Owner

trinker commented Apr 24, 2014

I pushed to CRAN today: http://cran.r-project.org/web/packages/qdapTools/index.html

Kirill your last name got jacked up because I tried to use non ascii characters. I changed to Muller but if you have a way to use the accent mark in the DESCRIPTION file please pull request.

The next step is to start removing these functions from qdap and using importFrom qdapTools where needed and add as a Dependency

@krlmlr
Copy link
Author

krlmlr commented Apr 24, 2014

Thanks a ton for your efforts and for your ultrafast response! Muller is ok, I really wonder if anyone still uses R on a platform that has no Unicode support...

@trinker
Copy link
Owner

trinker commented Apr 24, 2014

Yeah I love using R but when I saw this post http://www.r-bloggers.com/a-weekend-with-julia-an-r-users-reflections/ on julia's use/handling of unicode characters I was definitely intrigued.

@krlmlr
Copy link
Author

krlmlr commented Apr 24, 2014

I've heard about that, though I think you can use Unicode identifiers in R (at least if your system is using a Unicode locale):

> ü <- 3
> ü
[1] 3

Anyway... Are you adding a release to https://github.com/trinker/qdapTools/releases ?

@krlmlr
Copy link
Author

krlmlr commented Apr 24, 2014

Wrong:

> € <- 4
Error: unexpected input in "�"

@trinker
Copy link
Owner

trinker commented Apr 24, 2014

Thanks for the release suggestion. Didn't know you could do that.

@krlmlr
Copy link
Author

krlmlr commented Apr 24, 2014

You're welcome. I usually copy the relevant parts of NEWS.md into the description of the release.

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

No branches or pull requests

2 participants