I am very new to RStudio and to tidyverse, so please pardon my ignorance. I am trying to prepare a set of plays for computational analysis (including tf-idf) but am running into difficulties from the get-go. I tried to follow Text Mining with R, using a text file I have prepared, but when I type the following:
baillie.v <- scan("14 plays from Collected stripped intervening metadata.txt", what="character", sep= "\n")
text_df <- tibble(line = 1:4, text = baillie.v)
I receive this error:
Error: Tibble columns must have compatible sizes.
Size 4: Existing data.
Size 43934: Column text.
i Only values of size one are recycled.
Having looked through similar topics, I see that "tibble does not automatically recycle vectors to match length, hence the error." But I do not know how to apply the fix suggested there to my variable.
Better things, it looks like! (See below.)
Thank you for your help. Now I can move on working through these exercises.
Sincerely,
Steve
text_df <- tibble(text = baillie.v)
text_df
A tibble: 43,934 x 1
text
1 _____________________________________________~
2 ORRA: A TRAGEDY, IN FIVE ACTS.
3 PERSONS OF THE DRAMA. MEN Hughobert , Count o~
4 Glottenbal , his son.
5 Theobald of Falkenstein , a nobleman of reduc~
6 Rudigere , a knight, and commander of one of ~
7 Hartman , friend of Theobald , and Banneret o~
8 Urston , a confessor.
9 Franko , chief of a band of outlaws.
10 Maurice , an agent of Rudigere ' s.