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

use 'fixed = TRUE' where possible #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChrisMuir
Copy link

I was poking around in this repo some, figured I'd submit this. The majority of this PR just adds arg fixed = TRUE wherever possible, which is an easy way to get a small speed boost from functions strsplit(), grepl(), and gsub().

The only other edit is to add arg stringsAsFactors = TRUE to the call to as.data.frame() in line 179 of KWIC.R (see here ). Without this arg, variable Var1 from table() ends up as a factor, and when you subset kwf in line 180, that variable holds onto all of the levels that existed prior to subsetting, which makes the final data frame kwf a much larger object than it needs to be.

Let me know if you want anything tweaked, I'm happy to make edits if need be.

@aravind-j aravind-j self-requested a review August 6, 2018 18:18
@aravind-j aravind-j self-assigned this Aug 6, 2018
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

Successfully merging this pull request may close these issues.

2 participants