sinx (version 0.0.13)

sinx: Sino Xmen's sayings the R community.

Description

Sino Xmen's sayings the R community.

Usage

sinx(
  which = NULL,
  sinxs.data = NULL,
  fixed = TRUE,
  showMatches = FALSE,
  author = character(),
  ...
)

Arguments

which

an integer specifying the row number of `sinxs.data`. Alternatively `which`` can be a character and `grep`` is used to try to find a suitable row.

sinxs.data

data frame containing a saying in each row. By default the data from the 'sinx' package are used.

fixed

logical passed to `grep` if `which`` is a character, indicating if it should work (if `TRUE`, as by default) with a simple character string or (if `FALSE`) with regular expressions.

showMatches

if `which` is character, a logical indicating if `sinx()` should print all the row numbers of `sinxs.data` which match the `grep` search.

author

a character string to match (via `grep`) to the "authors" column of `sinxs.data`.

...

potential further arguments passed to `grep`.

Value

an object of class "sinx" which is a row from a data frame of sayings (like those read in from read.sinxs).

Examples

Run this code
# NOT RUN {
sinx()

for (i in 1:4) print(sinx(i))

path_f <- system.file("fortunes/fortunes.csv", package = "fortunes")
path_s <- system.file("sinxs/sinxs.csv", package = "sinx")
ftns <- sinx::read.sinxs(c(path_f, path_s), sep = c(";", ","))
sinx::sinx(sinxs.data = ftns)

jinyong <- read.sinxs(lib = "jinyong")
sinx(sinxs.data = jinyong)

libs <- read.sinxs(lib = c("tangshi", "songshi", "chinese", "yangsheng", "english", 
    "jinyong"))
sinx(sinxs.data = libs)
# }

Run the code above in your browser using DataLab