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

word() Ignore error when end = parameter is greater than the size of the string #112

Closed
diegocgaona opened this issue Apr 25, 2016 · 0 comments

Comments

@diegocgaona
Copy link

Hi,

Very useful package!

I'm trying to use the word() with Facebook posts text, to put then on a table. The problem is that I don't know how much words the string contain.
When I use the command:
fb_sent_comments_agg$post_text <- word(fb_sent_comments_agg$post_text, end = 5)

I receive the error:
Error in word[loc, "end"] : subscript out of bounds

Could be possible to do something when the string have less than 5 words? For example, end = works like:
if more than n words, cut the string after n, else don't cut the string.

Thanks!!

@hadley hadley closed this as completed in 4139b7a Jul 19, 2016
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

1 participant