Commit afc4307d authored by Dirk Eddelbuettel's avatar Dirk Eddelbuettel

Import Upstream version 2.7.1

parent f3ad6726
......@@ -22,7 +22,7 @@ CFLAGS = @CFLAGS@
CPICFLAGS = @CPICFLAGS@
CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@ @R_DEFS@
DISTDIR_TAR_EXCLUDE = --exclude=.svn --exclude=CVS --exclude=Makefile --exclude="*.o" --exclude="*$(SHLIB_EXT)"
DISTDIR_TAR_EXCLUDE = --exclude=.svn --exclude=CVS --exclude=Makefile --exclude="*~" --exclude="*.o" --exclude="*$(SHLIB_EXT)"
DVIPS = @DVIPS@
DYLIB_EXT = @DYLIB_EXT@
DYLIB_LD = @DYLIB_LD@
......
......@@ -99,7 +99,7 @@ svnonly:
@if test ! -f "$(srcdir)/doc/FAQ" || test -f non-tarball ; then \
(cd doc/manual && $(MAKE) front-matter html-non-svn) ; \
touch non-tarball ; \
(cd $(srcdir); LC_ALL=C TZ=GMT svn info || $(ECHO) "Revision: unknown") 2> /dev/null \
(cd $(srcdir); LC_ALL=C TZ=GMT svn -rHEAD info || $(ECHO) "Revision: unknown") 2> /dev/null \
| sed -n -e '/^Revision/p' -e '/^Last Changed Date/'p \
| cut -d' ' -f1,2,3,4 > SVN-REVISION-tmp ; \
$(top_srcdir)/tools/move-if-change SVN-REVISION-tmp SVN-REVISION ; \
......
This diff is collapsed.
Revision: 45424
Last Changed Date: 2008-04-22
Revision: 45970
Last Changed Date: 2008-06-23
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -134,6 +134,7 @@ Other types of extensions are supported: @xref{Package types}.
* Writing portable packages::
* Diagnostic messages::
* Internationalization::
* CITATION files::
* Package types::
* Services::
@end menu
......@@ -455,6 +456,10 @@ running @command{R CMD check}. Only encoding names @code{latin1},
specify an encoding unless one is actually needed: doing so makes the
package @emph{less} portable.)
The optional @samp{OS_ype} field specifies the OSes for which the
package is intended. If present, it should be one of @code{unix} or
@code{windows}, and indicates that the package should only be installed
on a platform with @samp{.Platform$OS.type} having that value.
The optional @samp{Type} field specifies the type of the package:
@pxref{Package types}.
......@@ -645,12 +650,16 @@ the top level of the package will @emph{not} be installed and so not be
known to users of Windows and MacOS X compiled packages (and not seen by
those who use @command{R CMD INSTALL} or @command{install.packages} on
the tarball). So any information files you wish an end user to see
should be included in @file{inst}. One thing you might like to add to
@file{inst} is a @file{CITATION} file for use by the @code{citation}
function. Note that if the named exceptions also occur in @file{inst},
the version in @file{inst} will be that seen in the installed package.
If you want @file{NEWS} to be installed by your package in earlier
versions of @R{}, you need to include it in @file{inst}.
should be included in @file{inst}.
@findex CITATION
@cindex citation
One thing you might like to add to @file{inst} is a @file{CITATION} file
for use by the @code{citation} function. Note that if the named
exceptions also occur in @file{inst}, the version in @file{inst} will be
that seen in the installed package. If you want @file{NEWS} to be
installed by your package in earlier versions of @R{}, you need to
include it in @file{inst}.
Subdirectory @file{tests} is for additional package-specific test code,
similar to the specific tests that come with the @R{} distribution.
......@@ -1403,13 +1412,15 @@ To exclude files from being put into the package, one can specify a list
of exclude patterns in file @file{.Rbuildignore} in the top-level source
directory. These patterns should be Perl regexps, one per line, to be
matched against the file names relative to the top-level source
directory. In addition, directories called @file{CVS} or @file{.svn} or
@file{.arch-ids} and files @file{GNUMakefile} or with base names
starting with @samp{.#}, or starting and ending with @samp{#}, or ending
in @samp{~}, @samp{.bak} or @samp{.swp}, are excluded by default. In
addition, those files in the @file{R}, @file{demo} and @file{man}
directories which are flagged by @code{R CMD check} as having invalid
names will be excluded.
directory. In addition, directories from source control
systems@footnote{called @file{CVS} or @file{.svn} or @file{.arch-ids} or
@file{.bzr} or @file{git}.}, directories with names ending
@file{.Rcheck} or @file{Old} or @file{old} and files @file{GNUMakefile}
or with base names starting with @samp{.#}, or starting and ending with
@samp{#}, or ending in @samp{~}, @samp{.bak} or @samp{.swp}, are
excluded by default. In addition, those files in the @file{R},
@file{demo} and @file{man} directories which are flagged by @code{R CMD
check} as having invalid names will be excluded.
@c <FIXME>
@c From 1.8.0 on, the build code removes exclude files itself, rather
......@@ -2455,7 +2466,7 @@ in another language one might need to say `There is no package in library
@end itemize
@node Internationalization, Package types, Diagnostic messages, Creating R packages
@node Internationalization, CITATION files, Diagnostic messages, Creating R packages
@section Internationalization
There are mechanisms to translate the R- and C-level error and warning
......@@ -2560,7 +2571,59 @@ Packages without name spaces will need to use @code{domain="R-@var{pkg}"}
explicitly in calls to @code{stop}, @code{warning}, @code{message},
@code{gettext}/@code{gettextf} and @code{ngettext}.
@node Package types, Services, Internationalization, Creating R packages
@findex CITATION
@cindex citation
@node CITATION files, Package types, Internationalization, Creating R packages
@section CITATION files
An installed file named @file{CTIATION} will be used by the
@code{citation()} function. (To be installed, it needed to be in the
@file{inst} subdirectory of the package sources.)
The @file{CTIATION} file is parsed as @R{} code, currently in Latin-1.
(This will change once there is a means to declare an encoding.) If no
such file is present, @code{citation} generates a standard contents, and
an example of what that would look like as a @file{CTIATION} file can be
seen in recommended package @pkg{nlme} (see below): recommended packages
@pkg{boot}, @pkg{cluster} and @pkg{mgcv} have further examples.
A @file{CTIATION} file will contain calls to the functions
@code{citHeader}, @code{citEntry} and (optionally)
@code{citFooter}. Here is that for @pkg{nlme}, re-formatted:
@example
citHeader("To cite package 'nlme' in publications use:")
desc <- packageDescription("nlme")
year <- sub(".*(2[[:digit:]]@{3@})-.*", "\\1", desc$Date)
vers <- paste("R package version", desc$Version)
citEntry(entry="Manual",
title = "nlme: Linear and Nonlinear Mixed Effects Models",
author = personList(as.person("Jose Pinheiro"),
as.person("Douglas Bates"),
as.person("Saikat DebRoy"),
as.person("Deepayan Sarkar"),
as.person("the R Core team")),
year = year,
note = vers,
textVersion =
paste("Jose Pinheiro, Douglas Bates, Saikat DebRoy,",
"Deepayan Sarkar and the R Core team (",
year,
"). nlme: Linear and Nonlinear Mixed Effects Models. ",
vers, ".", sep=""))
@end example
Note the way that information that may need to be updated is picked up
from the @file{DESCRIPTION} file -- it is tempting to hardcode such
information, but it normally then gets outdated. See @code{?citEntry}
for further details of the information which can be provided.
The @file{CITATION} should itself produce no output.
@node Package types, Services, CITATION files, Creating R packages
@section Package types
The @file{DESCRIPTION} file has an optional field @code{Type} which if
......@@ -9023,7 +9086,7 @@ The following headers are included by @file{R.h}:
@end quotation
The graphics systems are exposed in headers
@file{R_ext/GraphicsEngine.h}, @file{R_ext/GraphicsDevice,h} (which it
@file{R_ext/GraphicsEngine.h}, @file{R_ext/GraphicsDevice.h} (which it
includes) and @file{R_ext/QuartzDevice.h}. Some entry points from the
@pkg{stats} package are in @file{R_ext/stats_package.h} (currently
related to the internals of @samp{nls} and @samp{nlminb}).
......
......@@ -971,7 +971,7 @@ and @code{NaN} values. To differentiate these, @code{is.nan(xx)} is only
@code{TRUE} for @code{NaN}s.
@findex is.nan
Missing values are sometimes printed as @code{<NA>}, when character
Missing values are sometimes printed as @code{<NA>} when character
vectors are printed without quotes.
@node Character vectors, Index vectors, Missing values, Simple manipulations numbers and vectors
......@@ -983,13 +983,13 @@ for example as plot labels. Where needed they are denoted by a sequence
of characters delimited by the double quote character, e.g.,
@code{"x-values"}, @code{"New iteration results"}.
Character strings are entered using either double (@code{"}) or single
(@code{'}) quotes, but are printed using double quotes (or sometimes
without quotes). They use C-style escape sequences, using @code{\} as
the escape character, so @code{\\} is entered and printed as @code{\\},
and inside double quotes @code{"} is entered as @code{\"}. Other
useful escape sequences are @code{\n}, newline, @code{\t}, tab and
@code{\b}, backspace.
Character strings are entered using either matching double (@code{"}) or
single (@code{'}) quotes, but are printed using double quotes (or
sometimes without quotes). They use C-style escape sequences, using
@code{\} as the escape character, so @code{\\} is entered and printed as
@code{\\}, and inside double quotes @code{"} is entered as @code{\"}.
Other useful escape sequences are @code{\n}, newline, @code{\t}, tab and
@code{\b}, backspace---see @command{?Quotes} for a full list.
Character vectors may be concatenated into a vector by the @code{c()}
function; examples of their use will emerge frequently.
......
......@@ -1250,9 +1250,9 @@ despite some claims to the contrary on the Microsoft site.} strings.
without extensive changes. As from @R{} 2.7.0 the @file{Rgui}
console@footnote{but not the GraphApp toolkit.} uses UCS-2 internally,
but communicates with the @R{} engine in the native encoding. To allow
UTF-8 strings to be printed in UTF-8, there is an escape convention is
used (see header @file{rgui_UTF8.h}) used by @code{cat}, @code{print}
and autoprinting.
UTF-8 strings to be printed in UTF-8, an escape convention is used (see
header @file{rgui_UTF8.h}) which is used by @code{cat}, @code{print} and
autoprinting.
`Unicode' (UCS-2LE) files are common in the Windows world, and
@code{readLines} and @code{scan} will read them into UTF-8 strings on
......@@ -1271,8 +1271,8 @@ encoding). Not all @code{CHARSXP}s are part of the cache -- notably
In @R{} 2.6.x and 2.7.x character strings created by @code{mkCharLen}
are not part of the cache: these were intended to be those containing
embedded nuls. As from @R{} 2.8.0 the cache will handle any content,
including strings with embedded nuls.
embedded nuls. As from @R{} 2.8.0 strings with embedded nuls will be
disallowed.
There are a few other ways in which @code{CHARSXP}s could or can escape
the cache. @code{CHARSXP}s reloaded from the @code{save} formats of
......@@ -2832,16 +2832,20 @@ standard text, and converted to UCS-2 in the plotting functions in file
Unicode symbol fonts, and symbols are handled in Adobe Symbol encoding.
Support for translucent colours (with alpha channel between 0 and 255)
was introduced in @R{} 2.6.0 for the screen device only. This is done
by drawing on a further internal bitmap, @code{xd->bm2}, in the opaque
version of the colour then alpha-blending that bitmap to @code{xd->bm}.
The alpha-blending routine is in a separate DLL, @file{msimg32.dll} that
is available on Windows 2000 or later and is loaded on first use. As
small a rectangular region as reasonably possible is alpha-blended (this
is rectangle @code{r} in the code), but things like mitre joins make
estimation of a tight bounding box too much work for lines and polygonal
boundaries. Translucent-coloured lines are not common, and the
performance seems acceptable.
was introduced in @R{} 2.6.0 for the screen device only, and extended to
the bitmap devices in @R{} 2.7.0.@footnote{It is technically possible to
use alpha-blending on metafile devices such as printers, but it seems
few drivers have support for this.} This is done by drawing on a further
internal bitmap, @code{xd->bm2}, in the opaque version of the colour
then alpha-blending that bitmap to @code{xd->bm}. The alpha-blending
routine is in a separate DLL, @file{msimg32.dll}, which is loaded on
first use.@footnote{It is avaliable on Windows 2000 or later, and so had
to be optional in @R{} 2.6.0.} As small a rectangular region as
reasonably possible is alpha-blended (this is rectangle @code{r} in the
code), but things like mitre joins make estimation of a tight bounding
box too much work for lines and polygonal boundaries.
Translucent-coloured lines are not common, and the performance seems
acceptable.
The support for a transparent background in @code{png()} predates full
alpha-channel support in @code{libpng} (let alone in PNG viewers), so
......@@ -2852,12 +2856,12 @@ uses this as the background colour (in @code{GA_NewPage} if the
specified background colour is transparent (and all non-opaque
background colours are treated as transparent). So this works by
marking that colour in the PNG file, and viewers without transparency
support see a slightly-off-white background, as if there were a near-white
canvas. Where a palette is used in the PNG file (if less than 256
colours were used) then this colour is recorded with full transparency
and the remaining colours as opaque. If 32-bit colour was available
then we could add a full alpha channel, but this is dependent on the
graphics hardware and undocumented properties of GDI.
support see a slightly-off-white background, as if there were a
near-white canvas. Where a palette is used in the PNG file (if less
than 256 colours were used) then this colour is recorded with full
transparency and the remaining colours as opaque. If 32-bit colour were
available then we could add a full alpha channel, but this is dependent
on the graphics hardware and undocumented properties of GDI.
@node Colours, Base graphics, Graphics devices, Graphics Devices
......@@ -2897,6 +2901,20 @@ and JPEGs from all but high-end digital cameras. The interpretation is
a matter for graphics devices and for code that manipulates colours, but
not for the graphics engine or subsystems.
@R{} uses a painting model similar to PostScript and PDF. This means
that where shapes (circles, rectangles and polygons) can both be filled
and have a stroked border, the fill should be painted first and then the
border (or otherwise only half the border will be visible). Where both
the fill and the border are semi-transparent there is some room for
interpretation of the intention. Most devices first paint the fill and
then the border, alpha-blending at each step. However, PDF does some
automatic grouping of objects, and @emph{when the fill and the border
have the same alpha}, they are painted onto the same layer and then
alpha-blended in one step. (See p. 569 of the PDF Reference Sixth
Edition, version 1.7. Unfortunately, although this is what the PDF
standard says should happen, it is not correctly implemented by some
viewers.)
@node Base graphics, Grid graphics, Colours, Graphics Devices
@section Base graphics
......
......@@ -4370,7 +4370,7 @@ string and vice versa.
Currently the inclusion of @code{\0} in a string constant terminates the
constant: further characters up to the closing quote are scanned but
ignored. (This will change in @R{} 2.8.0.)
ignored. (This will give a warning in @R{} 2.8.0.)
@node Identifiers, Reserved words, Literal constants, Tokens
@subsection Identifiers
......
......@@ -2215,8 +2215,7 @@ if test -z "${TCLTK_CPPFLAGS}"; then
CPPFLAGS="${CPPFLAGS} ${TCL_INCLUDE_SPEC}"
AC_CHECK_HEADER([tcl.h],
[TCLTK_CPPFLAGS="${TCL_INCLUDE_SPEC}"
found_tcl_h=yes
break])
found_tcl_h=yes])
CPPFLAGS="${r_save_CPPFLAGS}"
fi
if test "${found_tcl_h}" = no; then
......@@ -2260,8 +2259,7 @@ if test -z "${TCLTK_CPPFLAGS}"; then
CPPFLAGS="${CPPFLAGS} ${TCLTK_CPPFLAGS} ${TK_XINCLUDES} ${TK_INCLUDE_SPEC}"
AC_CHECK_HEADER([tk.h],
[TCLTK_CPPFLAGS="${TCLTK_CPPFLAGS} ${TK_INCLUDE_SPEC}"
found_tk_h=yes
break])
found_tk_h=yes])
CPPFLAGS="${r_save_CPPFLAGS}"
fi
if test "${found_tk_h}" = no; then
......
......@@ -941,26 +941,14 @@ msgstr ""
msgid "Jpeg file"
msgstr ""
#: ../library/grDevices/src/devWindows.c:896
msgid "Postscript files (*.ps)"
msgstr ""
#: ../library/grDevices/src/devWindows.c:897
msgid "Postscript file"
msgstr ""
#: ../library/grDevices/src/devWindows.c:908
msgid "PDF files (*.pdf)"
msgstr ""
#: ../library/grDevices/src/devWindows.c:909
msgid "PDF file"
msgstr ""
#: ../library/grDevices/src/devWindows.c:920
msgid "Enhanced metafiles (*.emf)"
msgstr ""
#: ../library/grDevices/src/devWindows.c:921
msgid "Enhanced metafiles"
msgstr ""
......
......@@ -299,10 +299,14 @@ sub mark_brackets {
my $extra_info = "\'$1\'" ;
$extra_info = "\'$1\'" if $line =~ /(\\\w+{)/ ; # }
if( $extra_info =~ /^'}'$/ ) {
warn "Note: unmatched right brace in '$Rdname'".
my $Rd = $Rdname;
$Rd =~ s/\.Rd$//;
warn "Note: unmatched right brace in file '$Rd.Rd'".
" on or after line $badlineno\n";
} elsif(! ($extra_info =~ /\\alias{/) ) { # }
warn "Warning: unmatched brace ($extra_info) in '$Rdname'".
my $Rd = $Rdname;
$Rd =~ s/\.Rd$//;
warn "Warning: unmatched brace ($extra_info) in file '$Rd.Rd'".
" on or after line $badlineno\n";
}
}
......@@ -657,12 +661,17 @@ sub transform_S3method {
## NB: \w includes _ as well as [:alnum:], which R now allows in name
my ($text) = @_;
my ($method, $prefix, $match, $rest);
my ($str, $ini, $fun, $cls, @args);
my $delimround = new Text::DelimMatch("\\(", "\\)");
$delimround->quote('"');
$delimround->quote("'");
my $S3method_RE =
"([ \t]*)\\\\(S3)?method\{([\\w.]+)\}\{([\\w.]+)\}";
while($text =~ /$S3method_RE(.*)/s) {
$ini = $1;
$fun = $3;
$cls = $4;
$method = "method";
($prefix, $match, $rest) = $delimround->match($5);
if(($prefix eq "") && ($rest =~ m/^[ \t]*<-/)) {
......@@ -670,20 +679,19 @@ sub transform_S3method {
## that we could check for a syntacticaly valid R name.)
$method = "replacement method";
}
if($4 eq "default") {
$text =~
s/$S3method_RE/$1\#\# Default S3 $method:\n$1$3/s;
if($cls eq "default") {
$str = "$ini\#\# Default S3 $method:\n$ini$fun";
}
else {
$text =~
s/$S3method_RE/$1\#\# S3 $method for class '$4':\n$1$3/s;
$str = "$ini\#\# S3 $method for class '$cls':\n$ini$fun";
}
$text =~ s/$S3method_RE/$str/s;
}
## Also try to handle markup for S3 methods for subscripting and
## subassigning.
$S3method_RE = "([ \t]*)\\\\(S3)?method" .
"\{(\\\$|\\\[\\\[?)\}\{([\\w.]+)\}\\\(([^)]+)\\\)";
my ($str, $name, @args);
while($text =~ /$S3method_RE(.*)/s) {
## <NOTE>
## The hard part is to rewrite the argument list, because
......@@ -697,20 +705,22 @@ sub transform_S3method {
## parentheses (e.g., in default argument strings), so we use
## Text::DelimMatch.
## </NOTE>
$str = "$1\#\# S3 method for class '$4':\n$1";
$name = $3;
$ini = $1;
$fun = $3;
$cls = $4;
$method = "method";
## The match was for something ending in a pair of balanced
## parentheses, which are not necessarily the matching ones.
($prefix, $match, $rest) = $delimround->match("($5)$6");
$method = "replacement method" if($rest =~ m/^[ \t]*<-/);
## Extract the first argument from the argument list.
substr($match, 1, -1) =~ m/\s*([^,]+),\s*(.*)/s;
## Now put things together.
$str .= "$1$name$2";
$str .= "]" x length($name) if($name ne "\$");
$str =~ s/method/replacement method/ if($rest =~ m/^[ \t]*<-/);
$str = "$ini\#\# S3 $method for class '$cls':\n$ini$1$fun$2";
$str .= "]" x length($fun) if($fun ne "\$");
$text =~ s/$S3method_RE.*/$str$rest/s;
}
## Also try to handle markup for S3 methods for binary ops and S3
## Ops group methods.
$S3method_RE = "([ \t]*)\\\\(S3)?method" .
......@@ -722,21 +732,21 @@ sub transform_S3method {
")\}\{([\\w.]+)\}\\\(([^)]+)\\\)";
while($text =~ /$S3method_RE/) {
$str = "$1\#\# S3 method for class '$4':\n$1";
$name = $3;
$fun = $3;
@args = split(/,\s*/, $5);
my $nargs = scalar(@args);
if(($nargs == 1) && ($name eq "!")) {
if(($nargs == 1) && ($fun eq "!")) {
## Unary: !.
$str .= "$name $args[0]";
$str .= "$fun $args[0]";
}
elsif(($nargs == 2) && ($name ne "!")) {
elsif(($nargs == 2) && ($fun ne "!")) {
## Binary: everything but !.
$str .= "$args[0] $name $args[1]";
$str .= "$args[0] $fun $args[1]";
}
else {
##
warn "Warning: arity problem for \\$2method{$name}{$4}?\n";
$str .= "`$name`($5)";
warn "Warning: arity problem for \\$2method{$fun}{$4}?\n";
$str .= "`$fun`($5)";
}
$text =~ s/$S3method_RE/$str/s;
}
......@@ -747,16 +757,57 @@ sub transform_S4method {
## \S4method{GENERIC}{SIGLIST}
## Note that this markup should really only be used inside \usage.
my ($text) = @_;
my ($method, $prefix, $match, $rest);
my ($str, $ini, $fun, $sig, @args);
my $delimround = new Text::DelimMatch("\\(", "\\)");
$delimround->quote('"');
$delimround->quote("'");
my $S4method_RE =
"([ \t]*)\\\\S4method\{([\\w.]+)\}\{([\\w.,]+)\}";
"([ \t]*)\\\\(S4)method\{([\\w.]+)\}\{([\\w.,]+)\}";
## Use grouping on 'S4' so that the S3 method code can easily be
## reused.
local($Text::Wrap::columns) = 60;
while($text =~ /$S4method_RE/) {
my $pretty = wrap("$1\#\# ", "$1\#\# ",
"S4 method for signature '" .
join(", ", split(/,/, $3)) . "':\n") .
"$1$2";
$text =~ s/$S4method_RE/$pretty/s;
while($text =~ /$S4method_RE(.*)/s) {
$ini = $1;
$fun = $3;
$sig = join(", ", split(/,/, $4));
$method = "method";
($prefix, $match, $rest) = $delimround->match($5);
if(($prefix eq "") && ($rest =~ m/^[ \t]*<-/)) {
## (Note that the RHS should really be called 'value', and
## that we could check for a syntacticaly valid R name.)
$method = "replacement method";
}
$str = wrap("$ini\#\# ", "$ini\#\# ",
"S4 $method for signature '$sig':\n") .
"$ini$fun";
$text =~ s/$S4method_RE/$str/s;
}
## Also try to handle markup for S4 methods for subscripting and
## subassigning. See transform_S3method() above for details.
$S4method_RE = "([ \t]*)\\\\(S4)method" .
"\{(\\\$|\\\[\\\[?)\}\{([\\w.,]+)\}\\\(([^)]+)\\\)";
while($text =~ /$S4method_RE(.*)/s) {
$ini = $1;
$fun = $3;
$sig = join(", ", split(/,/, $4));
$method = "method";
## The match was for something ending in a pair of balanced
## parentheses, which are not necessarily the matching ones.
($prefix, $match, $rest) = $delimround->match("($5)$6");
$method = "replacement method" if($rest =~ m/^[ \t]*<-/);
## Extract the first argument from the argument list.
substr($match, 1, -1) =~ m/\s*([^,]+),\s*(.*)/s;
## Now put things together.
$str = wrap("$ini\#\# ", "$ini\#\# ",
"S4 $method for signature '$sig':\n") .
"$ini$1$fun$2";
$str .= "]" x length($fun) if($fun ne "\$");
$text =~ s/$S4method_RE.*/$str$rest/s;
}
$text;
}
......
/*
* Copyright (C) Martin Maechler, 1994, 1998
* Copyright (C) 2001-2007 the R Development Core Team
* Copyright (C) 2001-2008 the R Development Core Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -53,8 +53,8 @@
* "g" and "G" puts them into scientific format if it saves
* space to do so.
* NEW: "fg" gives numbers in "xxx.xxx" format as "f",
* ~~ however, digits are *significant* digits and no
* trailing zeros are produced, as in "g".
* ~~ however, digits are *significant* digits and,
* if digits > 0, no trailing zeros are produced, as in "g".
*
* flag Format modifier as in K&R "C", 2nd ed., p.243;
* e.g., "0" pads leading zeros; "-" does left adjustment
......@@ -70,6 +70,7 @@
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <R_ext/Error.h> /* error */
#include <R_ext/Memory.h> /* R_alloc */
......@@ -99,9 +100,10 @@ void str_signif(char *x, int *n, const char **type, int *width, int *digits,