Description Usage Arguments Value Examples
View source: R/set_meta_tags.R
Set the metatags
attribute on a term_count
/token_count
object. Meta tags called in tidy_counts
.
1 2 3 4 5 6 7 | set_meta_tags(x, tags, ...)
## S3 method for class 'data.frame'
set_meta_tags(x, tags, ...)
## S3 method for class 'list'
set_meta_tags(x, tags, ...)
|
x |
A |
tags |
A data.frame with a |
... |
ignored. |
Returns a term_count
/token_count
object with the
metatags
attribute set.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | token_list2 <- list(
list(
person = c('sam', 'i')
),
list(
place = c('here', 'house'),
thing = c('boat', 'fox', 'rain', 'mouse', 'box', 'eggs', 'ham')
),
list(
no_like = c('not like'),
thing = c('train', 'goat'),
other = c('in')
),
list(
other = 'i'
)
)
x <- token_count(sam_i_am, grouping.var = TRUE, token.list = token_list2)
attributes(x)[['metatags']]
tag_list <- list(
noun = c('person', 'place', 'thing'),
odd_ones = c('other', 'no_like')
)
library(textshape)
tag_df <- tidy_list(list(
noun = c('person', 'place', 'thing'),
odd_ones = c('other', 'no_like')
), 'meta', 'tag')[, 2:1]
x2 <- set_meta_tags(x, tag_list)
attributes(x2)[['metatags']]
x3 <- set_meta_tags(x, tag_df)
attributes(x3)[['metatags']]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.