Skip to content

Commit

Permalink
version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkowa authored and cran-robot committed Apr 20, 2015
1 parent 28b6688 commit c9cc0f0
Show file tree
Hide file tree
Showing 13 changed files with 216 additions and 94 deletions.
14 changes: 7 additions & 7 deletions DESCRIPTION
@@ -1,15 +1,15 @@
Package: sparkTable
Type: Package
Title: Sparklines and graphical tables for tex and html
Version: 0.12.0
Date: 2014-11-17
Author: Alexander Kowarik, Bernhard Meindl, Matthias Templ
Title: Sparklines and Graphical Tables for TeX and HTML
Version: 1.0.0
Date: 2015-04-17
Author: Alexander Kowarik, Bernhard Meindl, Matthias Templ
Maintainer: Alexander Kowarik <alexander.kowarik@statistik.gv.at>
Description: Create Sparklines and graphical tables for documents and websites
Description: Create sparklines and graphical tables for documents and websites.
Depends: utils, methods, Cairo, gridExtra, ggplot2,shiny, Rglpk
Imports: xtable,StatMatch,boot,pixmap,RGraphics,grid
License: GPL
Packaged: 2014-11-17 09:32:39 UTC; KOWA$
Packaged: 2015-04-20 05:05:25 UTC; KOWA$
NeedsCompilation: no
Repository: CRAN
Date/Publication: 2014-11-17 11:17:59
Date/Publication: 2015-04-20 17:53:33
24 changes: 12 additions & 12 deletions MD5
@@ -1,13 +1,13 @@
7d997ea130d7d1373e97c48856b6f5e1 *DESCRIPTION
64b9c4fd82ae0d2a4b11cdc47c95b71f *DESCRIPTION
dd849dede7f6697510f27ab376bdf3cb *NAMESPACE
db5909adffac0080d001d442069d0a87 *R/auxFunctions.r
d3265ca4910cb2b77d750fc8c438a6e0 *R/checkerplot.R
ade0db99202cba1a2d9f083be6bda90f *R/classes.r
38953c3c4bf817aff3afd705401a85d1 *R/classes.r
1d8e9c40f8d7ca7745f35b556158e4c3 *R/customizeSparkTable.R
599f963631bda4e64d351a4dcff4d471 *R/exports.r
b71f5ff5f9bcd7c0c0826b7b37ee71d7 *R/methods.r
33548a8b81c68d96bd1bed2f975cb7c1 *R/exports.r
56b2c4e569d847c83a4073d9e5ec77b5 *R/methods.r
62caa3015b12162ed6242786c8167f57 *R/optimal_grid_allocation.R
b239d2bdc2a1196aed159c88e7ead208 *R/showSparkTable.R
d5bd7defdffc9360b019071389b421be *R/showSparkTable.R
37203ac7f0c1fdb703205f6131fe6eb2 *R/zzz.R
5511fddf06f7fcc8986542f4c2135cb8 *README
91c73c864c6c09888ace45876af545d8 *data/AT_Soccer.RData
Expand Down Expand Up @@ -112,27 +112,27 @@ a75b00c72cf7d77e531af0db80e40056 *inst/etc/Flaggen/USStates/VA.pnm
34747457dfb2e543d849531ee9a7e1b9 *inst/etc/Flaggen/USStates/WV.pnm
313f8a0a5d795fe371b9b32d0c788ce7 *inst/etc/Flaggen/USStates/WY.pnm
d6062b9a3361daca1427662307433267 *inst/shinystuff/shinypara_global.R
e09dadbc3c460b8652245af0b022b8f3 *inst/shinystuff/shinypara_server.R
a8be565b4f1c7a44a7c87d060ff019a1 *inst/shinystuff/shinypara_server.R
25ae39835ea52a9e96c0021cee048a19 *inst/shinystuff/shinypara_ui.R
c5a728e8d02ec89af0bb59a085a2f0d9 *inst/shinystuff/www/js/jquery-ui.min.js
ba88f287c6599582d9c4c418964fcc4d *inst/shinystuff/www/js/sort.js
0abc22df76cc1cab707b9ce8553f45c0 *inst/shinystuff/www/sort.css
69e7d0ce71a3758c5a21f11f3969ccd4 *man/brp.Rd
1d047c694f4938a8cb9a6ca3a2d48678 *man/checkerplot.Rd
50ae71a674d0f70a24a25619a983fefa *man/customizeSparkTable.Rd
d8e3abca8cd36a7e0b8e449085c79ac0 *man/export.Rd
b48a9913d8012248fc41cf3c469a79ef *man/export.Rd
bc67373f236e6fa13be2086c98aab887 *man/geoTable-class.Rd
81d3feed6523851ab20c8543b7fb2edc *man/getParameter.Rd
fd8694a5209cbf3b0b5ebd60653482bc *man/newGeoTable.Rd
e237388eb303aa2b417ca56b23ef4742 *man/newSparkBar.Rd
f76f7aa816e060b99d7435c26cc38c2b *man/newSparkTable.Rd
8c40f30d7137c343391f45ab7d81ead6 *man/newSparkBar.Rd
8682775dda9bded1fa5871a3588e2510 *man/newSparkTable.Rd
696b08140407645476d52a1346bcfa7b *man/optimal_grid_allocation.Rd
d76fcbd8274c7822dc5103512fb54d2a *man/plot.Rd
1538af45f7d2f56ff4c71b83ff7d4518 *man/reshapeExt.Rd
829f09d28f694d64a5f86e3fca5c9322 *man/setParameter.Rd
fe805654a59dd56da404b0b44e1db6b0 *man/setParameter.Rd
5b205689f943560649be1f284e3712a5 *man/showSparkTable.Rd
d82181cec8a4319bc5126812381b16df *man/sparkTable-class.Rd
854560491ab8112b8731062a674e5783 *man/sparkbar-class.Rd
5ce2c2a7d1d589a53c61abb806470ac2 *man/sparkbox-class.Rd
789f884dd5a6dac5be035823800f22b0 *man/sparkbar-class.Rd
fbdb6df4d95d23ecb8278466f8bbbb2f *man/sparkbox-class.Rd
66c92422d348c4fe57371b31bc54ac13 *man/sparkline-class.Rd
4ce6c3d828a9acc0c4ad521ef874796a *man/summaryST.Rd
20 changes: 12 additions & 8 deletions R/classes.r
Expand Up @@ -16,8 +16,8 @@ setClass(
coordsY="numeric"
),
prototype=prototype(
width=1.5,
height=.3,
width=3.5,
height=1,
values=rpois(20, 5)*sample(c(1,-1), 20, replace=TRUE),
padding=c(5,5,5,5), #top,bottom,left,right
availableWidth=NULL,
Expand Down Expand Up @@ -46,13 +46,13 @@ setClass(
setClass(
Class="sparkline",
representation=representation(
allColors="ANY", # 1=min,2=max,3=last,4=fill,5=line,6=iqr
allColors="ANY", # 1=min,2=max,3=last,4=fillbackground,5=line,6=iqr
pointWidth="numeric",
lineWidth="numeric",
showIQR="logical"
),
prototype=prototype(
allColors=c('red', 'green', 'blue', 'orange', 'black', 'grey'),
allColors=c('red', 'green', 'blue', 'white', 'black', '#bbbbbb'),
pointWidth=4, # point Width
lineWidth=1,
showIQR=FALSE
Expand Down Expand Up @@ -85,12 +85,14 @@ setClass(
representation=representation(
barCol="ANY",
barWidth="numeric",
barSpacingPerc="numeric"
barSpacingPerc="numeric",
bgCol="ANY"
),
prototype=prototype(
barCol=c("#0000ff", "#ff0000", "#000000"), # negativ, positiv, lines
barWidth=NULL,
barSpacingPerc=2
barSpacingPerc=2,
bgCol="white"
),
validity=function(object) {
if ( !is.null(object@barCol) && length(object@barCol) != 3 )
Expand All @@ -114,12 +116,14 @@ setClass(
representation=representation(
outCol="ANY", # outlierColor
boxCol="ANY", # 1=lineColor,2=fillColor
boxLineWidth="numeric"
boxLineWidth="numeric",
bgCol="ANY"
),
prototype=prototype(
outCol=c('orange'),
boxCol=c('#000000', 'orange'),
boxLineWidth=1
boxLineWidth=1,
bgCol="white"
),
validity=function(object) {
if ( sd(object@values, na.rm=T) == 0 )
Expand Down
39 changes: 35 additions & 4 deletions R/exports.r
Expand Up @@ -119,7 +119,8 @@ newSparkLine <- function(width=NULL, height=NULL, values=NULL, padding=NULL, all
x
}

newSparkBar <- function(width=NULL, height=NULL, values=NULL, padding=NULL, barCol=NULL, barWidth=NULL, barSpacingPerc=NULL, vMin=NULL, vMax=NULL,outputType="html") {
newSparkBar <- function(width=NULL, height=NULL, values=NULL, padding=NULL, barCol=NULL, barWidth=NULL, barSpacingPerc=NULL,
vMin=NULL, vMax=NULL,bgCol=NULL,outputType="html") {
x <- new('sparkbar')
if ( !is.null(width) ){
width(x) <- width
Expand Down Expand Up @@ -150,11 +151,15 @@ newSparkBar <- function(width=NULL, height=NULL, values=NULL, padding=NULL, barC
}else if(outputType=="tex"){
barSpacingPerc(x) <- 15
}
if ( !is.null(bgCol) ){
bgCol(x) <- bgCol
}
x <- scaleSpark(x, vMin=vMin, vMax=vMax)
x
}

newSparkHist <- function(width=NULL, height=NULL, values=NULL, padding=NULL, barCol=NULL, barWidth=NULL, barSpacingPerc=NULL, vMin=NULL, vMax=NULL,outputType="html") {
newSparkHist <- function(width=NULL, height=NULL, values=NULL, padding=NULL, barCol=NULL, barWidth=NULL, barSpacingPerc=NULL,
vMin=NULL, vMax=NULL,bgCol=NULL,outputType="html") {
x <- new('sparkhist')
if ( !is.null(width) ){
width(x) <- width
Expand Down Expand Up @@ -185,12 +190,15 @@ newSparkHist <- function(width=NULL, height=NULL, values=NULL, padding=NULL, bar
}else if(outputType=="tex"){
barSpacingPerc(x) <- 15
}
if ( !is.null(bgCol) ){
bgCol(x) <- bgCol
}
x <- scaleSpark(x, vMin=vMin, vMax=vMax)
x
}
newSparkBox <- function(width=NULL, height=NULL, values=NULL, padding=NULL, boxOutCol=NULL,
boxMedCol=NULL, boxShowOut=NULL, boxCol=NULL, boxLineWidth=NULL,
vMin=NULL, vMax=NULL,outputType="html") {
vMin=NULL, vMax=NULL,bgCol=NULL,outputType="html") {
x <- new('sparkbox')
if ( !is.null(width) ){
width(x) <- width
Expand Down Expand Up @@ -222,6 +230,9 @@ newSparkBox <- function(width=NULL, height=NULL, values=NULL, padding=NULL, boxO
boxShowOut(x) <- boxShowOut
if ( !is.null(boxCol) )
boxCol(x) <- boxCol
if ( !is.null(bgCol) ){
bgCol(x) <- bgCol
}
x <- scaleSpark(x, vMin=vMin, vMax=vMax)
x
}
Expand Down Expand Up @@ -256,7 +267,17 @@ reshapeExt <- function(
idvar=names(dat)[1]
)
}
dat[,attr(dat,"reshapeLong")[["timevar"]]] <- rep(timeValues,nrow(dat)/n1)
#dat[,attr(dat,"reshapeLong")[["timevar"]]] <- rep(timeValues,nrow(dat)/n1)
valTime <- 1
for(i in 1:NROW(dat)){
if(i>1){
if(dat[i,1]!=dat[i-1,1]){
valTime <- 1
}
}
dat[i,attr(dat,"reshapeLong")[["timevar"]]] <- valTime
valTime <- valTime + 1
}
}else{
dat <- list()
for(co in unique(x[,geographicVar])){
Expand Down Expand Up @@ -376,6 +397,10 @@ setParameter <- function(object, value, type) {
if ( type == 'barSpacingPerc' ) {
barSpacingPerc(object) <- value
}
# sparkbar,sparkbox, sparkhist
if ( type == 'bgCol' ) {
bgCol(object) <- "value"
}
# sparkTable-objects
if ( type == 'dataObj' ) {
dataObj(object) <- value
Expand Down Expand Up @@ -441,6 +466,11 @@ getParameter <- function(object, type) {
if ( type == 'barSpacingPerc' ) {
out <- barSpacingPerc(object)
}
# sparkbar,sparkbox, sparkhist
if ( type == 'bgCol' ) {
out <- bgCol(object)
}

# sparkTable-objects
if ( type == 'dataObj' ) {
out <- dataObj(object)
Expand All @@ -461,6 +491,7 @@ getParameter <- function(object, type) {
if ( type == 'geographicOrder' ) {
out <- geographicOrder(object)
}

out
}

0 comments on commit c9cc0f0

Please sign in to comment.