Description Usage Arguments Value Examples
View source: R/get_sentences.R
get_sentences
- Get sentences from a character vector, sentiment
, or
sentiment_by
object.
1 | get_sentences(x, ...)
|
x |
A character vector, |
... |
Other arguments passed to |
Returns a list of vectors of sentences.
1 2 3 4 5 6 7 8 9 10 11 12 | dat <- data.frame(
w = c('Person 1', 'Person 2'),
x = c(paste0(
"Mr. Brown comes! He says hello. i give him coffee. i will ",
"go at 5 p. m. eastern time. Or somewhere in between!go there"
), "One more thought for the road! I am going now. Good day."),
y = state.name[c(32, 38)],
z = c(.456, .124),
stringsAsFactors = FALSE
)
get_sentences(dat$x)
get_sentences(dat)
|
[[1]]
[1] "Mr. Brown comes!" "He says hello."
[3] "i give him coffee." "i will go at 5 p.m. eastern time."
[5] "Or somewhere in between!" "go there"
[[2]]
[1] "One more thought for the road!" "I am going now."
[3] "Good day."
attr(,"class")
[1] "get_sentences" "get_sentences_character"
[3] "list"
w x y z element_id
1: Person 1 Mr. Brown comes! New York 0.456 1
2: Person 1 He says hello. New York 0.456 1
3: Person 1 i give him coffee. New York 0.456 1
4: Person 1 i will go at 5 p.m. eastern time. New York 0.456 1
5: Person 1 Or somewhere in between! New York 0.456 1
6: Person 1 go there New York 0.456 1
7: Person 2 One more thought for the road! Pennsylvania 0.124 2
8: Person 2 I am going now. Pennsylvania 0.124 2
9: Person 2 Good day. Pennsylvania 0.124 2
sentence_id
1: 1
2: 2
3: 3
4: 4
5: 5
6: 6
7: 1
8: 2
9: 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.