File: progress.bar.R

package info (click to toggle)
r-cran-rjags 1%3A4-8-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 452 kB
  • sloc: cpp: 676; ansic: 70; makefile: 2; sh: 2
file content (27 lines) | stat: -rw-r--r-- 976 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#  R package rjags file R/unix/progress.bar.R
#  Copyright (C) 2009-2013 Martyn Plummer
#
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License version
#  2 as published by the Free Software Foundation.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  A copy of the GNU General Public License is available at
#  http://www.r-project.org/Licenses/
#

updatePB <- function(start.iter, end.iter, adapting)
{
  tcltk::tkProgressBar(title=ifelse(adapting, "Adapting","Updating"),
                        label="Iteration 0", min = start.iter, max=end.iter,
                        initial=start.iter)
}

setPB <- function(pb, iter)
{
  tcltk::setTkProgressBar(pb, iter, label=paste("Iteration",iter))
}