mkhtml: make HTML report with text and images

Description Usage Arguments Value Examples

View source: R/mkhtml.R

Description

Make HTML report from rayout dataframe. This is a wrapper function of "hwrite" in the "hwriter" package.

Usage

1
mkhtml(filename, data, foot = TRUE, charset = "CP932", lang = "JP")

Arguments

filename

character.A filename for output.

data

3 columns dataframe. left column:text or a image file name, middle column:choose a text size LL/L/M/S, right column:image file or not, image file=1, others =0. See Example.

foot

logical. If TRUE, the bottom row is converted into foot note.

charset

character. Default charset is "CP932".

lang

character. Default language code is "JP".

Value

NULL(a HTML file)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#prepare a image file.
png("sample.png")
plot(iris$Sepal.Length, iris$Sepal.Width)
dev.off()

#make a dataframe for the report rayout
df <- data.frame("This is a sample report.", "LL", stringsAsFactors=FALSE)
df[2,] <- c("This is a caption.", "L")
df[3,] <- c("This is a caption2.", "M")
df[4,] <- c("This is a text.", "S")
df[5,] <- c("sample.png", "S")
df[6,] <- c("This is a foot note", "S")

mkhtml("sample.html", df)

#If you use a web-browser supporting CSS3, you can edit text parts on it.

batade documentation built on May 2, 2019, 11:04 a.m.