Learn R Programming

sparkTable (version 0.1.3)

sparkEPS: Create a sparkline as EPS graphic

Description

The function creates an EPS file of the selected type and with given parameters.

Usage

sparkEPS(filename, para, type)

Arguments

filename
the name of the file where the data will be saved.
para
list of parameters produces by the spark_init function
type
either "line", "bar", or "box"

See Also

print.sparkTable, setPara, sparkTable_Config, spark, spark_init, sparkHTML,, sparkEPS

Examples

Run this code
# GDP per capita in Purchasing Power Standards (PPS) (EU-27 = 100)

data(gdp)

meta <- sparkTable_Config(gdp, groups=c("EU27","AT","DE","TR"), 
		groupVar="region", 
		vars=c("gdp"), 
		typeNumeric=list(c("min","max","last"))	, 
		typePlot=c("line","bar"),
		output="eps")

# creating a tex-document in the directory examples
obj <- print(meta,outdir="examples",outfile="gdp.tex")

# --------------------------------

# production index 
data(dat)

pi_konsum <- dat$Konsumgueter[6:67]

# creating a line, box plot and bar plot
para <- spark_init(pi_konsum, type="line")
sparkEPS("examples/pi_konsum_line.eps",para,type="line")

para <- spark_init(pi_konsum, type="box")
sparkEPS("examples/pi_konsum_box.eps",para,type="box")

para <- spark_init(pi_konsum, type="bar")
sparkEPS("examples/pi_konsum_bar.eps",para, type="bar")

Run the code above in your browser using DataLab