substring - split each character in R -
I have I want to loop songs and fill in the elements of each list Because each element has a letter vector in the list, where the element of each vector is a word in the song as "pseudo," "no", "feel", "" "" "" "" "" "" "" "" "First of all I has created an empty list, I think I should put the text first in a long character vector What should I do next? It looks like you Run The result should be a list of each poem, in each poem there should be each element of the vector consisting of each word. IF You are not working with a single character string in the read-in object, show us the file and how you are reading it;). song.txt file
*** ** [1] "White night shines on the snowy hill" should not be seen. [2] "A state of isolation, and it seems that I am queen" [3] "Wind revolves like this swirling storm which can not keep it inside; Paradise knows that I have tried" *** [4] "Do not let them see them, do not let them see" [5] "Be nice girl, you do not always feel free to leave, do not let them know" [6] "Now they know" ** ***
[1] "" "" "" "" "" "" "" "" "" "" "Footprint" "" "" can be seen "." "A" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" " "" I can not "try" "" "" "" "" "" "" "" "" "" "" "" "inside" "" "" "" "" " "" "Good girl" "always" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
words <-> vector ( "List", 2) .
***** with respect to the serial number and start
star = "\\ * {5}" pindex = grep (star, page)
strsplit , therefore, "the point of a single long character string divided by **** and spaces" (which I think is what you have?). Starts with:
list_of_vectors & lt; - lapply (strsplit (song, split = "\\ * {5}"), function (x) {# split every poem by space - variant & lt; - strsplit (x, split = "") # Returns as a vector return (List (Split_verse))})
Comments
Post a Comment