How do I turn the values in a subset into text so that I can generate a wordcloud?

  Kiến thức lập trình

From a large tabular data set (using read.csv function) I have created a subset from a column that lists different job roles in the rows.



[995] physician

[996] painter

[997] engineer


[999] architect


[ reached getOption(“max.print”) — omitted 2634 entries ]

I would now like to turn this list into a wordcloud but have been unable to do so using the following:


wordcloud2(data=jobs_mysubset, size=5)

However, this gives me the following error: Error in `[.data.frame`(data, , 1:2) : undefined columns selected

How do I resolve this error? I don’t think R recognises the words as data. How can I fix that?

I have also tried

jobs_mysubset <- text_dataframe %>% unnest_tokens(word, text) %>% anti_join(stopwords("en") jobs_mysubsetf = freq_dataframe %>% count(word)

This gives me the error code: Error: unexpected symbol in:

Error: unexpected symbol in: “jobs_mysubset <- text_dataframe %>% unnest_tokens(word, text) %>% anti_join(stopwords(“en”) jobs_mysubset”

New contributor

student123 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.