extract token using R

0 votes
I am trying to extract a token from a file. The problem is that the lines get merged and extracts every word with token as prefix or postfix.
Nov 16, 2018 in Data Analytics by Ali
• 10,290 points
12 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Just add collapse = FALSE in your unnest_tokens:

library(tidytext)
library(dplyr)

jobs %>% 
  unnest_tokens(ngram, POSITION, token = "ngrams", n = 2, collapse = FALSE)
answered Nov 16, 2018 by Maverick
• 10,000 points

Related Questions In Data Analytics

0 votes
1 answer

How to extract every nth element of a vector using R?

m <- 1:50 n<- m[seq(1, length(m), 6)] The above ...READ MORE

answered May 14, 2018 in Data Analytics by zombie
• 3,690 points
2,107 views
0 votes
1 answer

How to change y axis max in time series using R?

The axis limits are being set using ...READ MORE

answered Apr 3, 2018 in Data Analytics by darklord
• 6,140 points
42 views
0 votes
1 answer
0 votes
1 answer

How to use group by for multiple columns in dplyr, using string vector input in R?

dplyr added versions for group_by. This allows you ...READ MORE

answered Apr 12, 2018 in Data Analytics by CodingByHeart77
• 3,680 points

edited Apr 12, 2018 by CodingByHeart77 1,679 views
0 votes
1 answer

Why is data cleaning needed?

Data cleaning is the fourth step in ...READ MORE

answered Nov 14, 2018 in Data Analytics by Maverick
• 10,000 points
10 views
0 votes
1 answer

What are the steps in data analysis process?

Need to follow these steps: Data requirements – ...READ MORE

answered Nov 14, 2018 in Data Analytics by Maverick
• 10,000 points
20 views
0 votes
1 answer

How to change the value of a variable using R programming in a data frame?

Try this: df$symbol <- as.character(df$symbol) df$symbol[df$symb ...READ MORE

answered Jan 11 in Data Analytics by Tyrion anex
• 8,280 points
47 views
0 votes
1 answer

Parallel programming In R using GPU

Check out the CRAN Task View on High-Performance ...READ MORE

answered Feb 4 in Data Analytics by Tyrion anex
• 8,280 points
43 views
0 votes
1 answer

Downloading an image using R Programming

Try this: url2 ...READ MORE

answered Nov 2, 2018 in Data Analytics by Maverick
• 10,000 points
17 views
0 votes
1 answer

Cleaning data using R

Try something like this: text1='"id","gender","age","category1","category2","category3","category4","category5","category6","category7","category8","category9","category10" 1,"Male",22,"movies","music","travel","cloths","grocery",,,,, 2,"Male",28,"travel","books","movies",,,,,,, 3,"Female",27,"rent","fuel","grocery","cloths",,,,,, 4,"Female",22,"rent","grocery","travel","movies","cloths",,,,, 5,"Female",22,"rent","online-shopping","utiliy",,,,,,,' d1 <- read.table(text=text1, sep=",", ...READ MORE

answered Nov 13, 2018 in Data Analytics by Maverick
• 10,000 points
18 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.