Skip to contents

Export to xlsx

Usage

kindle_write_xlsx(
  data,
  file,
  columns = NULL,
  distinct = TRUE,
  drop_na = TRUE,
  new_line = TRUE,
  title = NULL
)

Arguments

data

The data read from kindle_read().

file

The file name to write to.

columns

A character vector. Select and reorder variables in a data frame. Choose from the following values:

  • id: The row number.

  • title: Name of the book.

  • page: The number of page of the excerpt in the book.

  • begin: The starting position of the excerpt in the book.

  • end: The ending position of the excerpt in the book.

  • datetime: The time when the excerpt is took down.

  • text: Excerpted content.

distinct

Logical. If TRUE, the last record with the same begin value will be retained; if FALSE, no records will be deleted.

drop_na

Logical. If TRUE, drop rows where text column is NA; if FALSE, no records will be deleted.

new_line

Logical. If TRUE, will be replaced by \n which can create a new line.

title

String. Provide the title of the data you want to write out, with support for regular expressions. If NULL, all of records will be wrote out.

Value

A excel file.

Examples

if (FALSE) {
text <- kindle_read("tests/testthat/My-Clippings.txt")
kindle_write_xlsx(text, "tests/testthat/kindle_write.xlsx")
}