text_two_max_3: Generate Text Describing Three Maximum Two-Items

Description Usage Arguments Value Examples

View source: R/text_utils.R

Description

Generate Text Describing Three Maximum Two-Items

Usage

1
2
3
4
5
6
7
8
text_two_max_3(
  data,
  rate_text,
  item_name_1,
  item_name_2,
  rate_name,
  conjunction
)

Arguments

data

a data frame

rate_text

character. The character used in the text to represent the rate name.

item_name_1

character. The name of column in data storing the name of first item.

item_name_2

character. The name of column in data storing the name of second item.

rate_name

character. The name of column in data storing the value of rate.

conjunction

character. It is the conjunction between the first item and the second item to make the sentence more fluent.

Value

character of a sentence.

Examples

1
2
3
df <- data.frame(rate = runif(4), item1 = c("a",'b','c','d'), item2 = c("ab",'bc','cd','de'))
text_two_max_3(df, "\u6d4b\u8bd5\u7387", "item1", "item2", "rate")
text_two_max_3(df, "\u6d4b\u8bd5\u7387", "item1", "item2", "rate", conjunction = "")

YuanchenZhu2020/antgreens documentation built on Dec. 18, 2021, 8:20 p.m.