NEWS | R Documentation |
iconv()
no longer translates NA
strings as
"NA"
.
persp(box = TRUE)
now warns if the surface extends
outside the box (since occlusion for the box and axes is computed
assuming the box is a bounding box). (PR#202.)
RShowDoc()
can now display the licences shipped with
R, e.g. RShowDoc("GPL-3")
.
showNonASCIIfile()
in package
tools.
nobs()
now has a "mle"
method in package
stats4.
trace()
now deals correctly with S4 reference classes
and corresponding reference methods (e.g., $trace()
)
have been added.
xz
has been updated to 5.0.3 (very minor bugfix
release).
tools::compactPDF()
gets more compression (usually a
little, sometimes a lot) by using the compressed object streams of
PDF 1.5.
cairo_ps(onefile = TRUE)
generates encapsulated EPS
on platforms with cairo >= 1.6.
readChar()
and readBin()
)
are now supported on clipboard connections. (Wish of PR#14593.)
as.POSIXlt.factor()
now passes ...
to the
character method (suggestion of Joshua Ulrich). [Intended for R
2.13.0 but accidentally removed before release.]
vector()
and its wrappers such as integer()
and double()
now warn if called with a length
argument of more than one element. This helps track down user
errors such as calling double(x)
instead of
as.double(x)
.
make
from an SVN
checkout on a Unix-alike: a separate make vignettes
step
is no longer required.
These vignettes are now made with keep.source = TRUE
and
hence will be laid out differently.
make install-strip
failed under some configuration
options.
src/install.libs.R
script. This allows packages that
have architecture-specific binaries (beyond the package's shared
objects/DLLs) to be installed in a multi-architecture setting.
Sweave()
and Stangle()
gain an encoding
argument to specify the encoding of the vignette sources if the
latter do not contain a \usepackage[]{inputenc} statement
specifying a single input encoding.
figs.only = TRUE
to run
each figure chunk only for each selected graphics device, and not
first using the default graphics device. This will become the
default in R 2.14.0.
foo.off()
to shut them down.
split = TRUE
). Portable
names are regarded as alphanumeric plus hyphen, underscore, plus
and hash (periods cause problems with recognizing file
extensions).
Rtangle()
driver has a new option
show.line.nos
which is by default false; if true it
annotates code chunks with a comment giving the line number of the
first line in the sources (the behaviour of R >= 2.12.0).
.readRDS()
and
.saveRDS()
are now deprecated in favour of the public
functions readRDS()
and saveRDS()
introduced in R
2.13.0.
help()
types "postscript" and
"ps" are deprecated.
R CMD check
on a multi-architecture installation now
skips the user's ‘.Renviron’ file for the
architecture-specific tests (which do read the
architecture-specific ‘Renviron.site’ files). This is
consistent with single-architecture checks, which use
--no-environ.
R CMD build
now looks for ‘DESCRIPTION’
fields BuildResaveData and BuildKeepEmpty for
per-package overrides. See ‘Writing R Extensions’.
plot.lm(which = 5)
was intended to order factor
levels in increasing order of mean standardized residual. It
ordered the factor labels correctly, but could plot the wrong
group of residuals against the label. (PR#14545)
mosaicplot()
could clip the factor labels, and could
overlap them with the cells if a non-default value of
cex.axis
was used. (Related to PR#14550.)
dataframe[[row,col]]
now dispatches on [[
methods for the selected column (spotted by Bill Dunlap).
sort.int()
would strip the class of an object, but
leave its object bit set. (Reported by Bill Dunlap.)
pbirthday()
and qbirthday()
did not implement
the algorithm exactly as given in their reference and so were
unnecessarily inaccurate.
pbirthday()
now solves the approximate formula analytically
rather than using uniroot()
on a discontinuous function.
The description of the problem was inaccurate: the probability is a tail probablity (‘2 or more people share a birthday’)
seek(origin = "current")
incorrectly reported it was
not implemented for a gzfile()
connection.
c()
, unlist()
, cbind()
and
rbind()
could silently overflow the maximum vector length
and cause a segfault. (PR#14571)
fonts
argument to X11(type = "Xlib")
was
being ignored.
readBin()
) from a raw connection
was not advancing the pointer, so successive reads would read the
same value. (Spotted by Bill Dunlap.)
as.character.srcref()
. (Reported by Hadley
Wickham.)
decompose()
used with a series of a non-integer
number of periods returned a seasonal component shorter than the
original series. (Reported by Rob Hyndman.)
fields = list()
failed for setRefClass()
.
(Reported by Michael Lawrence.)
"ANY"
. (Reported by Janko Thyson.)
addmargins()
called numeric(apos)
rather than
numeric(length(apos))
.
tail.default()
is redefined by the user. (Problem reported
by Henrik Bengtsson.)
\eqn{}
may be used there.
isClass()
used its own namespace as the default of
the where
argument inadvertently.
replicate()
(by default) and vapply()
(always)
now return a higher-dimensional array instead of a matrix in the case
where the inner function value is an array of dimension >= 2.
normalizePath()
has been moved to the base
package (from utils): this is so it can be used by
library()
and friends.
It now does tilde expansion.
It gains new arguments winslash
(to select the separator on
Windows) and mustWork
to control the action if a canonical
path cannot be found.
model.frame
).
reformulate()
gains a intercept
argument.
cmdscale(add = FALSE)
now uses the more common
definition that there is a representation in n-1
or less
dimensions, and only dimensions corresponding to positive
eigenvalues are used. (Avoids confusion such as PR#14397.)
c()
, unlist()
, cbind()
and rbind()
are marked with an encoding when this can be
ascertained.
The PDF, PostScript, and Quartz graphics devices record this fact. X11 (and cairo) and Windows just assume that your screen conforms.
system.file()
gains a mustWork
argument
(suggestion of Bill Dunlap).
new.env(hash = TRUE)
is now the default.
list2env(envir = NULL)
defaults to hashing (with a
suitably sized environment) for lists of more than 100 elements.
text()
gains a formula method.
IQR()
now has a type
argument which is passed
to quantile()
.
as.vector()
, as.double()
etc duplicate less
when they leave the mode unchanged but remove attributes.
as.vector(mode = "any")
no longer duplicates when it does
not remove attributes. This helps memory usage in matrix()
and array()
.
matrix()
duplicates less if data
is an atomic vector
with attributes such as names (but no class).
dim(x) <- NULL
duplicates less if x
has neither
dimensions nor names (since this operation removes names and
dimnames).
setRepositories()
gains an addURLs
argument.
chisq.test()
now also returns a stdres
component, for standardized residuals (which have unit variance,
unlike the Pearson residuals).
write.table()
and friends gain a fileEncoding
argument, to simplify writing files for use on other OSes (e.g. a
spreadsheet intended for Windows or Mac OS X Excel).
foo::bar(x) <- y
and foo:::bar(x) <- y
now work; the replacement functions
used are foo::`bar<-`
and foo:::`bar<-`
.
Sys.getenv()
gains a names
argument so
Sys.getenv(x, names = FALSE)
can replace the common idiom
of as.vector(Sys.getenv())
. The default has been changed
to not name a length-one result.
options("install.lock")
may be set to FALSE
so that install.packages()
defaults to --no-lock
installs, or (on Windows) to TRUE
so that binary installs
implement locking.
sort(partial = p)
for large p
now tries
Shellsort if quicksort is not appropriate and so works for
non-numeric atomic vectors.
sapply()
gets a new option simplify = "array"
which returns a “higher rank” array instead of just a matrix
when FUN()
returns a dim()
length of two or more.
replicate()
has this option set by default, and
vapply()
now behaves that way internally.
aperm()
becomes S3 generic and gets a table
method which preserves the class.
merge()
and as.hclust()
methods for objects of
class "dendrogram"
are now provided.
as.POSIXlt()
now tries to
find a format that works for all non-NA
inputs, not just
the first one.
str()
now has a method for class "Date"
analogous to that for class "POSIXt"
.
file.link()
to create hard links on
those file systems (POSIX, NTFS but not FAT) that support them.
Summary()
group method for class "ordered"
implements min()
, max()
and range()
for
ordered factors.
mostattributes<-()
now consults the "dim"
attribute and not the dim()
function, making it more useful
for objects (such as data frames) from classes with methods for
dim()
. It also uses attr<-()
in preference to the
generics name<-()
, dim<-()
and dimnames<-()
.
(Related to PR#14469.)
"browserNLdisabled"
to disable
the use of an empty (e.g. via the ‘Return’ key) as a synonym
for c
in browser()
or n
under debug()
.
(Wish of PR#14472.)
example()
gains optional new arguments
character.only
and give.lines
enabling programmatic
exploration.
serialize()
and unserialize()
are no longer
described as ‘experimental’. The interface is now regarded
as stable, although the serialization format may well change in
future releases. (serialize()
has a new argument
version
which would allow the current format to be written
if that happens.)
New functions saveRDS()
and readRDS()
are public
versions of the ‘internal’ functions .saveRDS()
and
.readRDS()
made available for general use. The dot-name
versions remain available as several package authors have made use
of them, despite the documentation. readRDS()
no longer
wraps non-file connections in a call to gzcon()
, for
efficiency (see its documentation).
saveRDS()
supports compress = "xz"
.
read.dcf()
, dput()
,
dump()
, load()
, parse()
, readBin()
,
readChar()
, readLines()
, save()
,
writeBin()
, writeChar()
, writeLines()
,
.readRDS()
, .saveRDS()
and tools::parse_Rd()
,
as well as functions calling these.
find.package()
and path.package()
replace the internal dot-name versions.
terms()
now looks for a
"terms"
attribute if it does not find a "terms"
component, and so works for model frames.
httpd()
handlers receive an additional argument
containing the full request headers as a raw vector (this can be
used to parse cookies, multi-part forms etc.). The recommended
full signature for handlers is therefore function(url,
query, body, headers, ...)
.
file.edit()
gains a fileEncoding
argument to
specify the encoding of the file(s).
isSeekable()
now returns FALSE
on connections
which have non-default encoding
. Although documented to
record if ‘in principle’ the connection supports seeking,
it seems safer to report FALSE
when it may not work.
R CMD REMOVE
and remove.packages()
now
remove file R.css
when removing all remaining packages in a
library tree. (Related to the wish of PR#14475: note that this
file is no longer installed.)
unzip()
now has a unzip
argument like
zip.file.extract()
. This allows an external
unzip
program to be used, which can be useful to access
features supported by Info-ZIP's unzip
version 6 which
is now becoming more widely available.
zip()
function, as wrapper for an
external zip
command.
bzfile()
connections can now read from concatenated
bzip2
files (including files written with
bzfile(open = "a")
) and files created by some other
compressors (such as the example of PR#14479).
c()
is now of type BUILTIN.
plot(<dendrogram>, .., nodePar=*)
now obeys an optional
xpd
specification (allowing clipping to be turned off
completely).
nls(algorithm="port")
now shares more code with
nlminb()
, and is more consistent with the other
nls()
algorithms in its return value.
xz
has been updated to 5.0.1 (very minor bugfix
release).
image()
has gained a logical useRaster
argument allowing it to use a bitmap raster for plotting a
regular grid instead of polygons. This can be more efficient, but
may not be supported by all devices. The default is FALSE
.
list.files()
/dir()
gains a new argument
include.dirs()
to include directories in the listing when
recursive = TRUE
.
list.dirs()
lists all directories,
(even empty ones).
file.copy()
now (by default) copies
read/write/execute permissions on files, moderated by the current
setting of Sys.umask()
.
Sys.umask()
now accepts mode = NA
and returns
the current umask
value (visibly) without changing it.
!
method for classes "octmode"
and
"hexmode"
: this allows xor(a, b)
to work if both
a
and b
are from one of those classes.
as.raster()
no longer fails for vectors or matrices
containing NA
s.
"before.new.plot"
allows functions to be run
just before advancing the frame in plot.new
, which is
potentially useful for custom figure layout implementations.
compactPDF()
to try to reduce the size of PDF files via qpdf
or gs
.
tar()
has a new argument extra_flags
.
dotchart()
accepts more general objects x
such
as 1D tables which can be coerced by as.numeric()
to a
numeric vector, with a warning since that might not be
appropriate.
create.post()
is now
exported from utils, and the documentation for
bug.report()
and help.request()
now refer to that
for create.post()
.
It has a new method = "mailto"
on Unix-alikes similar to
that on Windows: it invokes a default mailer via open
(Mac OS X) or xdg-open
or the default browser (elsewhere).
The default for ccaddress
is now
getOption("ccaddress")
which is by default unset: using the
username as a mailing address nowadays rarely works as expected.
options("mailer")
is now
"mailto"
on all platforms.
unlink()
now does tilde-expansion (like most other
file functions).
file.rename()
now allows vector arguments (of the
same length).
"glm"
method for logLik()
now returns an
"nobs"
attribute (which stats4::BIC()
assumed it
did).
The "nls"
method for logLik()
gave incorrect results
for zero weights.
nobs()
in package
stats, to extract from model objects a suitable value for
use in BIC calculations. An S4 generic derived from it is defined
in package stats4.
findClasses
, getGeneric
, findMethods
and hasMethods
are revised to deal consistently with
the package=
argument and be consistent with soft name space
policy for finding objects.
tools::Rdiff()
now has the option to return not only
the status but a character vector of observed differences (which
are still by default sent to ‘stdout’).
R --no-environ CMD
, R
--no-site-file CMD
or R --no-init-file CMD
sets
environment variables so these settings are passed on to child R
processes, notably those run by INSTALL
, check
and
build
. R --vanilla CMD
sets these three options
(but not --no-restore).
smooth.spline()
is somewhat faster. With
cv=NA
it allows some leverage computations to be skipped,
format.info(x)
, format(x)
, print(x)
,
etc, for numeric x
, has been re-written in order to provide
slightly more correct results, fixing PR#14491, notably in
border cases including when digits >= 16
, thanks to
substantial contributions (code and experiments) from Petr
Savicky. This affects a noticable amount of numeric output from
R.
grepRaw()
has been introduced for
finding subsets of raw vectors. It supports both literal searches
and regular expressions.
?compiler::compile
for information on how to
use the compiler. This package implements a byte code compiler
for R: by default the compiler is not used in this release. See
the ‘R Installation and Administration Manual’ for how to
compile the base and recommended packages.
exportPattern
directive in a NAMESPACE
file now causes classes to be exported according to the same
pattern, for example the default from package.skeleton()
to specify all names starting with a letter. An explicit
directive to exportClassPattern
will still over-ride.
"bytes"
for
character strings. This is intended to be used for non-ASCII
strings which should be treated as a set of bytes, and never
re-encoded as if they were in the encoding of the currrent locale:
useBytes = TRUE
is autmatically selected in functions such
as writeBin()
, writeLines()
, grep()
and
strsplit()
.
Only a few character operations are supported (such as substr()
).
Printing, format()
and cat()
will represent non-ASCII
bytes in such strings by a \xab escape.
removeSource()
removes the internally
stored source from a function.
"srcref"
attributes now include two additional
line number values, recording the line numbers in the order they
were parsed.
getSrcFilename()
, getSrcDirectory()
,
getSrcLocation()
and getSrcref()
.
Sys.chmod()
has an extra argument use_umask
which defaults to true and restricts the file mode by the current
setting of umask
. This means that all the R functions
which manipulate file/directory permissions by default respect
umask
, notably R CMD INSTALL
.
tempfile()
has an extra argument fileext
to
create a temporary filename with a specified extension.
(Suggestion and initial implementation by Dirk Eddelbuettel.)
There are improvements in the way Sweave()
and
Stangle()
handle non-ASCII vignette sources, especially in
a UTF-8 locale: see ‘Writing R Extensions’ which now has a
subsection on this topic.
factanal()
now returns the rotation matrix if a
rotation such as "promax"
is used, and hence factor
correlations are displayed. (Wish of PR#12754.)
gctorture2()
function provides a more refined
interface to the GC torture process. Environment variables
R_GCTORTURE, R_GCTORTURE_WAIT, and
R_GCTORTURE_INHIBIT_RELEASE can also be used to control the
GC torture process.
file.copy(from, to)
no longer regards it as an error
to supply a zero-length from
: it now simply does nothing.
rstandard.glm()
gains a type
argument which can
be used to request standardized Pearson residuals.
.libPaths()
calls normalizePath(winslash = "/")
on the paths: this helps (usually) to present them in a
user-friendly form and should detect duplicate paths accessed via
different symbolic links.
download.file()
can be now used with external methods
even if there are spaces in the URL or the target filename.
Sweave()
has options to produce PNG and JPEG figures,
and to use a custom function to open a graphics device (see
?RweaveLatex
).
Sweave()
is to produce only PDF
figures (rather than both EPS and PDF).
Sweave()
handles keep.source=TRUE
much better:
it could duplicate some lines and omit comments. (Reported by John
Maindonald and others.)
Rvprintf
and REvprintf
are only
defined by ‘R_ext/Print.h’ in C++ code if the macro
R_USE_C99_IN_CXX
is defined when it is included.
pythag
duplicated the C99 function hypot
. It
is no longer provided, but is used as a substitute for hypot
in the very unlikely event that the latter is not available.
R_inspect(obj)
and R_inspect3(obj, deep, pvec)
are (hidden) C-level entry points to the internal inspect
function and can be used for C-level debugging (e.g., in conjunction
with the p
command in gdb
).
gctorture()
or gctorture2()
and a
C-level debugger this can be useful for tracking down memory
protection issues.
R CMD Rdiff
is now implemented in R on
Unix-alikes (as it has been on Windows since R 2.12.0).
R CMD build
no longer does any cleaning in the
supplied package directory: all the cleaning is done in the copy.
It has a new option --install-args to pass arguments to
R CMD INSTALL
for --build (but not when
installing to rebuild vignettes).
There is new option, --resave-data, to call
tools::resaveRdaFiles()
on the ‘data’ directory, to
compress tabular files (‘.tab’, ‘.csv’ etc) and to
convert ‘.R’ files to ‘.rda’ files. The default,
--resave-data=gzip, is to do so in a way compatible even
with years-old versions of R, but better compression is given by
--resave-data=best, requiring R >= 2.10.0.
It now adds a ‘datalist’ file for ‘data’ directories of more than 1Mb.
Patterns in ‘.Rbuildignore’ are now also matched against all directory names (including those of empty directories).
There is a new option, --compact-vignettes, to try
reducing the size of PDF files in the ‘inst/doc’ directory.
Currently this tries qpdf
: other options may be used in
future.
When re-building vignettes and a ‘inst/doc/Makefile’ file is
found, make clean
is run if the makefile has a
clean:
target.
After re-building vignettes the default clean-up operation will remove any directories (and not just files) created during the process: e.g. one package created a ‘.R_cache’ directory.
Empty directories are now removed unless the option --keep-empty-dirs is given (and a few packages do deliberately include empty directories).
If there is a field BuildVignettes
in the package
‘DESCRIPTION’ file with a false value, re-building the
vignettes is skipped.
R CMD check
now also checks for filenames that are
case-insensitive matches to Windows' reserved file names with
extensions, such as ‘nul.Rd’, as these have caused problems
on some Windows systems.
It checks for inefficiently saved ‘data/*.rda’ and ‘data/*.RData’ files, and reports on those large than 100Kb. A more complete check (including of the type of compression, but potentially much slower) can be switched on by setting environment variable _R_CHECK_COMPACT_DATA2_ to TRUE.
The types of files in the data
directory are now checked,
as packages are still misusing it for non-R data files.
It now extracts and runs the R code for each vignette in a
separate directory and R process: this is done in the package's
declared encoding. Rather than call
tools::checkVignettes()
, it calls
tool::buildVignettes()
to see if the vignettes can be
re-built as they would be by R CMD build
. Option
--use-valgrind now applies only to these runs, and not
when running code to rebuild the vignettes. This version does a
much better job of suppressing output from successful vignette
tests.
The ‘00check.log’ file is a more complete record of what is output to ‘stdout’: in particular contains more details of the tests.
It now check all syntactically valid Rd usage entries, and warns about assignments (unless these give the usage of replacement functions).
‘.tar.xz’ compressed tarballs are now allowed, if
tar
supports them (and setting environment variable
TAR to internal ensures so on all platforms).
R CMD check
now warns if it finds
‘inst/doc/makefile’, and R CMD build
renames such a
file to ‘inst/doc/Makefile’.
perl
, and
R CMD
no longer tries to substitute a full path for
awk
nor perl
– this was a legacy from the
days when they were used by R itself. Because a couple of
packages do use awk
, it is set as the make
(rather than environment) variable AWK.
make check
will now fail if there are differences
from the reference output when testing package examples and if
environment variable R_STRICT_PACKAGE_CHECK is set to a true
value.
The C99 complex trigonometric functions (such as csin) are not currently required (FreeBSD lacks most of them): substitutes are used if they are missing.
configure
looks for support for OpenMP and if
found compiles R with appropriate flags and also makes them
available for use in packages: see ‘Writing R Extensions’.
This is currently experimental, and is only used in R with a
single thread for colSums()
and colMeans()
. Expect
it to be more widely used in later versions of R.
This can be disabled by the --disable-openmp flag.
R CMD INSTALL --clean
now removes copies of a
‘src’ directory which are created when multiple
sub-architectures are in use. (Following a comment from
Berwin Turlach.)
inst
that should not be installed. (Why should there be any
such files? Because all the files needed to re-build vignettes
need to be under inst/doc
, but they may not need to be
installed.)
R CMD INSTALL
has a new option
--compact-docs to compact any PDFs under the
‘inst/doc’ directory. Currently this uses qpdf
,
which must be installed (see ‘Writing R Extensions’).
lock
of install.packages()
can now be
use for Mac binary installs as well as for Windows ones. The
value "pkglock"
is now accepted, as well as TRUE
and
FALSE
(the default).
R CMD INSTALL
to retain a partially installed package for
forensic analysis.
R CMD check
, and will not be
allowed in R 2.14.x.
browseVignetttes()
).
require(save = TRUE)
is defunct, and use of the
save
argument is deprecated.
R CMD check --no-latex
is defunct: use
--no-manual instead.
R CMD Sd2Rd
is defunct.
gamma
argument to hsv()
,
rainbow()
, and rgb2hsv()
is deprecated
and no longer has any effect.
R CMD build --binary
(--auto-zip, --use-zip-data and
--no-docs) are deprecated (or defunct):
use the new option --install-args instead.
EXPR
argument in switch()
, only a single unnamed alternative
value is now allowed.
utils::link.html.help()
is no longer
available.
R CMD
INSTALL
options --use-zip-data and --auto-zip, as
well as the ZipData: yes field in a DESCRIPTION
file)
is defunct.
Installed packages with zip-ed data sets can still be used, but a warning that they should be re-installed will be given.
.Export()
etc is now defunct.
R CMD INSTALL
is
deprecated: use the identical option --no-lock instead.
pythag
in ‘Rmath.h’ is deprecated
in favour of the C99 function hypot
. A wrapper for
hypot
is provided for R 2.13.x only.
"source"
attribute of functions
is deprecated; use deparse(fn, control="useSource")
to access
it, and removeSource(fn)
to remove it.
R CMD build --binary
is now formally deprecated:
R CMD INSTALL --build
has long been the preferred
alternative.
drop.terms
and the [
method for class
"terms"
no longer add back an intercept. (Reported by
Niels Hansen.)
aggregate
preserves the class of a column (e.g. a
date) under some circumstances where it discarded the class
previously.
p.adjust()
now always returns a vector result, as
documented. In previous versions it copied attributes (such as
dimensions) from the p
argument: now it only copies names.
str()
method for class "POSIXt"
now gives
sensible output for 0-length input.
.requireCachedGenerics
to the dont.mind
list for library()
to avoid warnings about duplicates.
$<-.data.frame
messed with the class attribute,
breaking any S4 subclass. The S4 data.frame
class now has its own
$<-
method, and turns dispatch on for this primitive.
Map()
did not look up a character argument f
in the correct frame, thanks to lazy evaluation. (PR#14495)
file.copy()
did not tilde-expand from
and to
when to
was a directory. (PR#14507)
R CMD INSTALL
to crash a child R process and so leave
around a lock directory and a partially installed package. That
test is now done in a separate process.
plot(<formula>, data=<matrix>,..)
now works in more
cases; similarly for points()
, lines()
and
text()
.
edit.default()
contained a manual dispatch for matrices
(the "matrix"
class didn't really exist when it was written).
This caused an infinite recursion in the no-GUI case and has now
been removed.
data.frame(check.rows = TRUE)
sometimes worked when
it should have detected an error. (PR#14530)
scan(sep= , strip.white=TRUE)
sometimes stripped
trailing spaces from within quoted strings. (The real bug in
PR#14522.)
cor()
and
cov()
with use = "complete.obs"
computed the ranks
before removing missing values, whereas the documentation implied
incomplete cases were removed first. (PR#14488)
They also failed for 1-row matrices.
par("mex")
. (Part of PR#14532.)
debug()
, browser()
or otherwise) would display attributes such as "wholeSrcref"
that were intended for internal use only.
rc.settings(files =
TRUE)
).
uniroot(f, ...)
, -Inf
function values
are now replaced by a maximally negative value.
rowsum()
could silently over/underflow on integer
inputs (reported by Bill Dunlap).
as.matrix()
did not handle "dist"
objects with
zero rows.
max()
and min()
work harder to ensure that
NA
has precedence over NaN
, so e.g. min(NaN,
NA)
is NA
. (This was not previously documented except
for within a single numeric vector, where compiler optimizations
often defeated the code.)
stats4::BIC()
assumed without checking that an object
of class "logLik"
has an "nobs"
attribute:
glm()
fits did not and so BIC()
failed for them.
mantelhaen.test()
reported the p-value for the wrong tail. (PR#14514)
lty = NULL
to axis()
sent an invalid value to the graphics device, and might cause the
device to segfault.
Sweave()
with concordance=TRUE
could lead to
invalid PDF files; ‘Sweave.sty’ has been updated to avoid
this.
checkRd()
gave a spurious error if the \href
macro was used.
z^n
for complex z
and integer n
) gave incorrect results since R 2.10.0 on
platforms without C99 complex support. This and some
lesser issues in trignometric functions have been corrected.
Such platforms were rare (we know of Cygwin and FreeBSD).
However, because of new compiler optimizations in the way complex
arguments are handled, the same code was selected on x86_64 Linux
with gcc 4.5.x
at the default -O2
optimization
(but not at -O
).
rep()
, seq()
, seq.int()
and
seq_len()
report more often when the first element is taken
of an argument of incorrect length.
quartz()
graphics device
on Mac OS X provides a way to disable event loop processing
temporarily (useful, e.g., for forked instances of R).
kernel()
's default for m
was not appropriate
if coef
was a set of coefficients. (Reported by Pierre
Chausse.)
bug.report()
has been updated for the current R bug
tracker, which does not accept emailed submissions.
R CMD check
now checks for the correct use of
$(LAPACK_LIBS) (as well as $(BLAS_LIBS)), since
several CRAN recent submissions have ignored ‘Writing R
Extensions’.
gfortran
on x86_64 Linux has been changed back to -g
-O2: however, setting -g -O may still be needed for
gfortran 4.3.x
.
R CMD INSTALL
.
xz
compression: this for
example halves the installed size of package Imap.
R CMD INSTALL
now ensures that directories
installed from ‘inst’ have search permission for everyone.
It no longer installs files ‘inst/doc/Rplots.ps’ and
‘inst/doc/Rplots.pdf’. These are almost certainly left-overs
from Sweave
runs, and are often large.
.Export()
etc is now deprecated.
zip.file.extract()
is now deprecated.
R CMD
INSTALL --use-zip-data
and the ZipData: yes field in a
DESCRIPTION
file) is deprecated: using efficiently
compressed ‘.rda’ images and lazy-loading of data has
superseded it.
identical()
could in rare cases generate a warning
about non-pairlist attributes on CHARSXPs. As these are used for
internal purposes, the attribute check should be skipped.
(Reported by Niels Richard Hansen).
Sweave()
, source references would not
work properly and the keep.source
option failed. (PR#14459)
format.data.frame()
now keeps zero character column names.
pretty(x)
no longer raises an error when x
contains solely non-finite values. (PR#14468)
plot.TukeyHSD()
function now uses a line width of
0.5 for its reference lines rather than lwd = 0 (which
caused problems for some PDF and PostScript viewers).
big.mark
argument to prettyNum()
,
format()
, etc. was inserted reversed if it was more than
one character long.
R CMD check
failed to check the filenames under
‘man’ for Windows' reserved names.
"Date"
and "POSIXt"
methods for
seq()
could overshoot when to
was supplied and
by
was specified in months or years.
untar()
now restores hard
links as file copies rather than symbolic links (which did not
work for cross-directory links).
unzip()
did not handle zip files which contained
filepaths with two or more leading directories which were not in
the zipfile and did not already exist. (It is unclear if such
zipfiles are valid and the third-party C code used did not support
them, but PR#14462 created one.)
combn(n, m)
now behaves more regularly for the border
case m = 0. (PR#14473)
expression(10^2)
) used the current settings for conversion
to strings rather than setting the defaults, and so could be
affected by what has been done before. (PR#14477)
napredict()
and naresid()
for
na.action = na.exclude
fits did not work correctly in the
very rare event that every case had been omitted in the fit.
(Reported by Simon Wood.)
weighted.residuals(drop0=TRUE)
returned a vector when
the residuals were a matrix (e.g. those of class "mlm"
).
(Reported by Bill Dunlap.)
ccf(na.action = na.pass)
was not implemented.
20x2
. (Reported by Olaf Mersmann.)
format(*, zero.print)
did not always replace the full
zero parts.
"raster"
objects when not both i
and j
are specified.
R CMD INSTALL
was not always respecting the
ZipData: yes field of a ‘DESCRIPTION’ file (although
this is frequently incorrectly specified for packages with no data
or which specify lazy-loading of data).
R CMD INSTALL --use-zip-data
was incorrectly implemented
as --use-zipdata since R 2.9.0.
source(file, echo=TRUE)
could fail if the file
contained #line directives. It now recovers more gracefully, but
may still display the wrong line if the directive gives incorrect
information.
atan(1i)
returned NaN+Infi
(rather than
0+Infi
) on platforms without C99 complex support.
library()
failed to cache S4 metadata (unlike
loadNamespace()
) causing failures in S4-using packages
without a namespace (e.g. those using reference classes).
qlogis(lp, log.p=TRUE)
no longer
prematurely overflows to Inf
when exp(lp) is close to 1.
R CMD INSTALL
installed version-control directories from
source packages.
PROTECT
calls to some constructed expressions
used in C level eval
calls.
utils:::create.post()
(used by bug.report()
and help.request()
) failed to quote arguments to the
mailer, and so often failed.
bug.report()
was naive about how to extract
maintainer email addresses from package descriptions, so would
often try mailing to incorrect addresses.
debugger()
could fail to read the environment of a
call to a function with a ...
argument. (Reported by
Charlie Roosen.)
prettyNum(c(1i, NA), drop0=TRUE)
or
str(NA_complex_)
now work correctly.
setRepositories()
.
reshape()
now makes use of sep
when forming
names during reshaping to wide format. (PR#14435)
legend()
allows the length of lines to be set by the
end user via the new argument seg.len
.
copy()
,
field()
, getRefClass()
and getClass()
have
been added to package methods.
EXPR
argument in switch()
, a warning is given if more than
one unnamed alternative value is given. This will become an
error in R 2.13.0.
StructTS(type = "BSM")
now allows series with just
two seasons. (Reported by Birgit Erni.)
seq.int()
no longer sometimes evaluates arguments
twice. (PR#14388)
data.frame
method of format()
failed if a
column name was longer than 256 bytes (the maximum length allowed
for an R name).
predict(<lm object>, type ="terms", ...)
failed if
both terms
and interval
were specified. (Reported
by Bill Dunlap.)
Also, if se.fit = TRUE
the standard errors were reported
for all terms, not just those selected by a non-null terms
.
cmdscale(eig = TRUE)
was documented to return n-1
eigenvalues but in fact only returned k
. It now returns
all n eigenvalues.
cmdscale(add = TRUE)
failed to centre the return
configuration and sometimes lost the labels on the points. Its
return value was described wrongly (it is always a list and
contains component ac
).
promptClass()
in package methods now works for
reference classes and gives a suitably specialized skeleton of
documentation.
Also, callSuper()
now works via the methods()
invocation as well as for initially specified methods.
download.file()
could leave the destination file open
if the URL was not able to be opened. (PR#14414)
"environment"
.
"environment"
generated an infinite recursion from the
method. The method has been replaced by internal code.
callSuper()
now works in
initialize()
methods when there is no explicit superclass
method.
list2env()
created an environment it was missing
a PROTECT
call and so was vulnerable to garbage collection.
Sweave()
with keep.source=TRUE
dropped
comments at the start and end of code chunks. It could also
fail when \SweaveInput was combined with named chunks.
nls(algorithm = "port")
could infinite-loop when compiled with high optimization on a
modern version of gcc
, and SAFE_FFLAGS
is now used
to make this less likely. (PR#14427, seen with 32-bit Windows
using gcc 4.5.0
used from R 2.12.0.)
sapply()
with default simplify = TRUE
and
mapply()
with default SIMPLIFY = TRUE
wrongly
simplified language-like results, as, e.g., in
mapply(1:2, c(3,7), FUN = function(i,j) call(':',i,j))
.
[g]sub(pcre = TRUE)
could cause a segfault. (PR#14431)
format()
(and hence the print()
) method
for class "Date"
rounded fractional dates towards zero: it
now always rounds them down.
"environment"
into
plain environments.
"environment"
(rm
, locking tools and active
bindings).
spec.ar()
now also work for the "ols"
method.
(Reported by Hans-Ruedi Kuensch.)
"environment"
now allocates a new environment object.
R CMD check
has more protection against (probably
erroneous) example or test output which is invalid in the current
locale.
qr.X()
with column names and pivoting now also pivots
the column names. (PR#14438)
unit.pmax()
and unit.pmin()
in package
grid gave incorrect results when all inputs were of length 1.
(PR#14443)
"raster"
objects when only one
of i
or j
is specified.
grid.raster()
in package grid did not accept
"nativeRaster"
objects (like rasterImage()
does).
With cairo < 1.6, will be better than before, though still a little clunky. With cairo >= 1.6, should be sweet as.
read.DIF()
: single column
inputs caused errors, cells marked as "character"
could
be converted to other types, and (in Windows) copying from the
clipboard failed.
difftime()
now defaults to the "tzone"
attribute of "POSIXlt"
objects rather than to the current
timezone as set by the default for the tz
argument. (Wish
of PR#14182.)
pretty()
is now generic, with new methods for
"Date"
and "POSIXt"
classes (based on code
contributed by Felix Andrews).
unique()
and match()
are now faster on
character vectors where all elements are in the global CHARSXP
cache and have unmarked encoding (ASCII). Thanks to Matthew
Dowle for suggesting improvements to the way the hash code is
generated in ‘unique.c’.
enquote()
utility, in use internally, is exported now.
.C()
and .Fortran()
now map non-zero return
values (other than NA_LOGICAL
) for logical vectors to
TRUE
: it has been an implicit assumption that they are
treated as true.
print()
methods for "glm"
and "lm"
objects now insert linebreaks in long calls in the same way that
the print()
methods for "summary.[g]lm"
objects
have long done. This does change the layout of the examples for
a number of packages, e.g. MASS. (PR#14250)
constrOptim()
can now be used with method
"SANN"
. (PR#14245)
It gains an argument hessian
to be passed to
optim()
, which allows all the ...
arguments to be
intended for f()
and grad()
. (PR#14071)
curve()
now allows expr
to be an object of
mode "expression"
as well as "call"
and
"function"
.
"POSIX[cl]t"
methods for Axis()
have been
replaced by a single method for "POSIXt"
.
There are no longer separate plot()
methods for
"POSIX[cl]t"
and "Date"
: the default method has
been able to handle those classes for a long time. This
inter alia allows a single date-time object to be
supplied, the wish of PR#14016.
The methods had a different default (""
) for xlab
.
"POSIXct"
, "POSIXlt"
and
"difftime"
have generators .POSIXct()
,
.POSIXlt()
and .difftime()
. Package authors are
advised to make use of them (they are available from R 2.11.0) to
proof against planned future changes to the classes.
The ordering of the classes has been changed, so "POSIXt"
is now the second class. See the document ‘Updating
packages for changes in R 2.12.x’ on
http://developer.r-project.org for the consequences for a
handful of CRAN packages.
"POSIXct"
method of as.Date()
allows a
timezone to be specified (but still defaults to UTC).
list2env()
utility function as an inverse of
as.list(<environment>)
and for fast multi-assign()
to existing environment. as.environment()
is now generic
and uses list2env()
as list method.
"lm"
and "glm"
fits, and in test
statistics in print.anova()
.
"dim"
, "names"
, etc, are
now allowed as slot names of S4 classes, with "class"
the
only remaining exception.
installed.packages()
has a new argument
subarch
to filter on sub-architecture.
summary()
method for packageStatus()
now
has a separate print()
method.
summary()
method returns an object
inheriting from class "summaryDefault"
which has a
separate print()
method that calls zapsmall()
for
numeric/complex values.
getGraphicsEvent()
mechanism now allows multiple windows
to return graphics events, through the new functions
setGraphicsEventHandlers()
, setGraphicsEventEnv()
, and
getGraphicsEventEnv()
. (Currently implemented in the
windows()
and X11()
devices.)
tools::texi2dvi()
gains an index
argument,
mainly for use by R CMD Rd2pdf
.
It avoids the use of texindy
by texinfo
's
texi2dvi >= 1.157
, since that does not emulate
'makeindex' well enough to avoid problems with special characters
(such as (, {, !) in indices.
readLines()
and scan()
to
re-encode inputs to marked UTF-8 strings on Windows since R 2.7.0
is extended to non-UTF-8 locales on other OSes.
scan()
gains a fileEncoding
argument to
match read.table()
.
points()
and lines()
gain "table"
methods to match plot()
. (Wish of PR#10472.)
Sys.chmod()
allows argument mode
to be a
vector, recycled along paths
.
|
, &
and xor()
methods for
classes "octmode"
and "hexmode"
, which work
bitwise.
tools::texi2dvi()
, the conventional environment variables
LATEX, MAKEINDEX and PDFLATEX will be used.
options("dvipscmd")
defaults to the value of DVIPS,
then to "dvips"
.)
isatty()
to see if terminal connections are
redirected.
summaryRprof()
returns the sampling interval in
component sample.interval
and only returns in
by.self
data for functions with non-zero self times.
print(x)
and str(x)
now indicate if an empty
list x
is named.
install.packages()
and remove.packages()
with
lib
unspecified and multiple libraries in
.libPaths()
inform the user of the library location used
with a message rather than a warning.
[bgx]zfile()
allow streams to be appended to an
existing file, but bzfile()
reads only the first stream.
person()
in package utils now uses
a given/family scheme in preference to first/middle/last, is
vectorized to handle an arbitrary number of persons, and gains a
role
argument to specify person roles using a controlled
vocabulary (the MARC relator terms).
"bibentry"
class
for representing and manipulating bibliographic information in
enhanced BibTeX style, unifying and enhancing the previously
existing mechanisms.
bibstyle()
function has been added to the
tools package with default JSS style for rendering
"bibentry"
objects, and a mechanism for registering other
rendering styles.
Rd2txt_options()
function.
options("help_text_width"
) is no longer used.
toRd()
generic in the tools package to
convert objects to fragments of Rd code, and added
"fragment"
argument to Rd2txt()
, Rd2HTML()
,
and Rd2latex()
to support it.
texmf
tree (‘root
directory’ in MiKTeX parlance).
?Methods
, section on
“Methods for S3 Generic Functions” for recommendations
and details.
format.pval()
gains a ...
argument to pass
arguments such as nsmall
to format()
. (Wish of
PR#9574)
legend()
supports title.adj
. (Wish of
PR#13415)
"raster"
objects, plus
assigning to a subset, conversion to a matrix (of colour
strings), and comparisons (== and !=).
parseLatex()
function (and related
functions deparseLatex()
and latexToUtf8()
) to
support conversion of bibliographic entries for display in R.
pdf()
,
postscript()
, x11(type="cairo")
, windows()
,
and quartz()
devices (and associated raster formats),
but not for x11(type="Xlib")
or xfig()
or
pictex()
. The user-level interface is the
polypath()
function in graphics and
grid.path()
in grid.
kmeans(x, 1)
now works. Further, kmeans
now
returns between and total sum of squares.
arrayInd()
and which()
gain an argument
useNames
. For arrayInd
, the default is now false,
for speed reasons.
print
method for
the formula class now displays the associated environment if it is
not the global environment.
?insertSource
.
readRenviron
to (re-)read files in the
format of ‘~/.Renviron’ and ‘Renviron.site’.
require()
will now return FALSE
(and not fail)
if loading the package or one of its dependencies fails.
aperm()
now allows argument perm
to be a
character vector when the array has named dimnames (as the results
of table()
calls do). Similarly, array()
allows
MARGIN
to be a character vector. (Based on suggestions of
Michael Lachmann.)
aspell_package_Rd_files()
and
aspell_package_vignettes()
for spell checking package Rd
files and vignettes using Aspell, Ispell or Hunspell.
news()
prefers these ‘inst/NEWS.Rd’ files to old-style
plain text ‘NEWS’ or ‘inst/NEWS’ files.
packageVersion()
.
The ‘.Rd’ conversion tools also warn about an unrecognized type in a \docType section.
ecdf()
objects now have a quantile()
method.
format()
methods for date-time objects now attempt to make
use of a "tzone"
attribute with "%Z"
and
"%z"
formats, but it is not always possible. (Wish of
PR#14358.)
tools::texi2dvi(file, clean = TRUE)
now works in more
cases (e.g. where emulation is used and when ‘file’ is not in
the current directory).
droplevels()
to remove unused factor levels.
system(command, intern = TRUE)
now gives an error on
a Unix-alike (as well as on Windows) if command
cannot be
run. It reports a non-success exit status from running
command
as a warning.
On a Unix-alike an attempt is made to return the actual exit
status of the command in system(intern = FALSE)
: previously
this had been system-dependent but on POSIX-compliant systems the
value return was 256 times the status.
system()
has a new argument ignore.stdout
which can be used to (portably) ignore standard output.
system(intern = TRUE)
and pipe()
connections
are guaranteed to be available on all builds of R.
Sys.which()
has been altered to return ""
if
the command is not found (even on Solaris).
?ReferenceClasses
.
predict
method for "loess"
fits gains an
na.action
argument which defaults to na.pass
rather
than the previous default of na.omit
.
Predictions from "loess"
fits are now named from the row
names of newdata
.
Sweave()
processing
will now be reported referencing their original location in the
source file.
adjustcolor()
utility, e.g., for simple
translucent color schemes.
qr()
now has a trivial lm
method with a
simple (fast) validity check.
?ReferenceClasses
.
R CMD
ensures that the ‘.bst’ and ‘.bib’ files
are found by BibTeX.
system
calls. This allows
values such as tar --force-local, but does require
additional quotes in, e.g., TAR = "'/path with spaces/mytar'"
.
R CMD check
no longer supports configuration
files containing Perl configuration variables: use the environment
variables documented in ‘R Internals’ instead.
save
argument of require()
now defaults to
FALSE
and save = TRUE
is now deprecated. (This
facility is very rarely actually used, and was superseded by the
Depends field of the ‘DESCRIPTION’ file long ago.)
R CMD check --no-latex
is deprecated in favour of
--no-manual.
R CMD Sd2Rd
is formally deprecated and will be
removed in R 2.13.0.
install.packages()
has a new argument
libs_only
to optionally pass --libs-only to
R CMD INSTALL
and works analogously for Windows binary
installs (to add support for 64- or 32-bit Windows).
Archs
field of the
‘DESCRIPTION’ file. There is a new default filter,
"subarch"
, in available.packages()
to make use of
this.
Code is compiled in a copy of the ‘src’ directory when a package is installed for more than one sub-architecture: this avoid problems with cleaning the sources between building sub-architectures.
R CMD INSTALL --libs-only
no longer overrides the
setting of locking, so a previous version of the package will be
restored unless --no-lock is specified.
R CMD Rprof|build|check
are now based on R rather
than Perl scripts. The only remaining Perl scripts are the
deprecated R CMD Sd2Rd
and install-info.pl
(used
only if install-info
is not found) as well as some
maintainer-mode-only scripts.
NB: because these have been completely rewritten, users should not expect undocumented details of previous implementations to have been duplicated.
R CMD
no longer manipulates the environment variables
PERL5LIB and PERLLIB.
R CMD check
has a new argument --extra-arch
to confine tests to those needed to check an additional
sub-architecture.
Its check for “Subdirectory 'inst' contains no files” is more thorough: it looks for files, and warns if there are only empty directories.
Environment variables such as R_LIBS and those used for customization can be set for the duration of checking via a file ‘~/.R/check.Renviron’ (in the format used by ‘.Renviron’, and with sub-architecture specific versions such as ‘~/.R/check.Renviron.i386’ taking precedence).
There are new options --multiarch to check the package
under all of the installed sub-architectures and
--no-multiarch to confine checking to the
sub-architecture under which check
is invoked. If
neither option is supplied, a test is done of installed
sub-architectures and all those which can be run on the current
OS are used.
Unless multiple sub-architectures are selected, the install done
by check
for testing purposes is only of the current
sub-architecture (via R CMD INSTALL --no-multiarch
).
It will skip the check for non-ascii characters in code or data if the environment variables _R_CHECK_ASCII_CODE_ or _R_CHECK_ASCII_DATA_ are respectively set to FALSE. (Suggestion of Vince Carey.)
R CMD build
no longer creates an ‘INDEX’ file
(R CMD INSTALL
does so), and --force
removes
(rather than overwrites) an existing ‘INDEX’ file.
It supports a file ‘~/.R/build.Renviron’ analogously to
check
.
It now runs build-time \Sexpr expressions in help files.
R CMD Rd2dvi
makes use of tools::texi2dvi()
to process the package manual. It is now implemented entirely in
R (rather than partially as a shell script).
R CMD Rprof
now uses utils::summaryRprof()
rather than Perl. It has new arguments to select one of the
tables and to limit the number of entries printed.
R CMD Sweave
now runs R with --vanilla
so
the environment setting of R_LIBS will always be used.
lang5()
and lang6()
(in addition to
pre-existing lang[1-4]()
) convenience functions for easier
construction of eval()
calls. If you have your own
definition, do wrap it inside #ifndef lang5 .... #endif
to keep it working with old and new R.
errno.h
. (This helps avoid problems
when it is included from C++ source files.)
access
, chdir
and
getcwd
are now essential to configure R. (In practice
they have been required for some time.)
make check
compares the output of the examples
from several of the base packages to reference output rather than
the previous output (if any). Expect some differences due to
differences in floating-point computations between platforms.
popen
system call is now required to build R.
This ensures the availability of system(intern = TRUE)
,
pipe()
connections and printing from postscript()
.
pkg-config
file ‘libR.pc’ now also works
when R is installed using a sub-architecture.
selectMethod()
by default no longer cache
inherited methods. This could previously corrupt methods used by
as()
.
dchisq(2000, 2,
1000)
, as a series expansion was truncated too early.
(PR#14105)
pt()
is more accurate in the left tail for ncp
large, e.g. pt(-1000, 3, 200)
. (PR#14069)
R_binary
) for binary ops now
sets the S4 bit in the result if either argument is an S4 object.
(PR#13209)
source(echo=TRUE)
failed to echo comments that
followed the last statement in a file.
"matrix"
,
"array"
or "ts"
and also another class now accept
superclass objects in new()
. Also fixes failure to call
validObject()
for these classes.
test
in
methods::setIs()
will no longer be used in S4 method
selection (caching these methods could give incorrect results).
See ?setIs
.
setGeneric()
when that does not use a definition nor
explicitly set a signature.
callNextMethod()
for some examples with
"..."
in the arguments has been fixed. See file
‘src/library/methods/tests/nextWithDots.R’ in the sources.
match(x, table)
(and hence %in%
) now treat
"POSIXlt"
consistently with, e.g., "POSIXct"
.
get()
,
assign()
, parent.env()
, is.environment()
and
others) now behave consistently to recognize S4 subclasses;
is.name()
also recognizes subclasses.
abs.tol
control parameter to nlminb()
now defaults to 0.0
to avoid false declarations of
convergence in objective functions that may go negative.
n
to avoid
problems with a damaged terminal connection. (PR#14332)
warn.unused
argument to hist.default()
to allow suppression of spurious warnings about graphical
parameters used with plot=FALSE
. (PR#14341)
predict.lm()
, summary.lm()
, and indeed
lm()
itself had issues with residual DF in zero-weighted
cases (the latter two only in connection with empty
models). (Thanks to Bill Dunlap for spotting the
predict()
case.)
aperm()
treated resize = NA
as resize =
TRUE
.
constrOptim()
now has an improved convergence
criterion, notably for cases where the minimum was (very close to)
zero; further, other tweaks inspired from code proposals by Ravi
Varadhan.
as.logical()
on factors (to use the
levels) was lost in R 2.6.0 and has been restored.
prompt()
did not backquote some default arguments in
the \usage section. (Reported by Claudia Beleites.)
writeBin()
disallows attempts to write 2GB or
more in a single call. (PR#14362)
new()
and getClass()
will now work if Class
is a subclass of "classRepresentation"
and should also be
faster in typical calls.
summary()
method for data frames makes a better
job of names containing characters invalid in the current locale.
[[
sub-assignment for factors could create an invalid
factor (reported by Bill Dunlap).
Negate(f)
would not evaluate argument f
until first use of returned function (reported by Olaf Mersmann).
quietly=FALSE
is now also an optional argument of
library()
, and consequently, quietly
is now
propagated also for loading dependent packages, e.g., in
require(*, quietly=TRUE)
.
for
loop was deleted, it
would be recreated as a global variable. (Reported by Radford
Neal; the fix includes his optimizations as well.)
getNamespaceVersion()
failed; this was an
accidental change in 2.11.0. (PR#14374)
identical()
returned FALSE
for external
pointer objects even when the pointer addresses were the same.
L$a@x[] <- val
did not duplicate in a case it should have.
tempfile()
now always gives a random file name (even
if the directory is specified) when called directly after
startup and before the R RNG had been used. (PR#14381)
quantile(type=6)
behaved inconsistently. (PR#14383)
backSpline(.)
behaved incorrectly when the knot
sequence was decreasing. (PR#14386)
0*x
and x*0
were always zero (whereas they could be
NA
or NaN
in IEC 60559 arithmetic). This was seen
in results from tcrossprod
, and for example that
log(0) %*% 0
gave 0
.
model.frame(drop.unused.levels = TRUE)
did not
take into account NA
values of factors when deciding to
drop levels. (PR#14393)
library.dynam.unload
required an absolute path for
libpath
. (PR#14385)
Both library()
and loadNamespace()
now record
absolute paths for use by searchpaths()
and
getNamespaceInfo(ns, "path")
.
NLSstClosestX
failed if some
deviation was exactly zero. (PR#14384)
X11(type = "cairo")
(and other devices such as
png
using cairographics) and which use Pango font selection
now work around a bug in Pango when very small fonts (those with
sizes between 0 and 1 in Pango's internal units) are requested.
(PR#14369)
X11(type =
"cairo")
and similar on Mac OS X whereby italic and bold styles
were interchanged. (PR#13463 amongst many other reports.)
source(chdir = TRUE)
failed to reset the working
directory if it could not be determined – that is now an error.
example(rasterImage)
on
x11(type="Xlib")
.
grid.cap()
in the Cocoa implementation. (PR#14260)
model.frame
had an unstated 500 byte limit on
variable names. (Example reported by Terry Therneau.)
[
, [[
or $
on an
expression object with value NULL
coerced the object to a
list.
install.packages()
has a new optional argument
INSTALL_opts
which can be used to pass options to
R CMD INSTALL
for source-package installs.
R CMD check
now runs the package-specific tests
with LANGUAGE=en to facilitate comparison to
‘.Rout.save’ files.
sessionInfo()
gives more detailed platform
information, including 32/64-bit and the sub-architecture if one
is used.
R CMD
check
(as previously documented in ‘Writing R
Extensions’) is deprecated and will be removed in R 2.12.0. Use
the environment variables documented in ‘R Internals’
instead.
R CMD Rd2dvi
failed if run from a path containing
space(s). This also affected R CMD check
, which calls
Rd2dvi
.
stripchart()
could fail with an empty factor
level. (PR#14317)
strsplit(x, fixed=TRUE)
marked UTF-8 strings with the
local encoding when no splits were found.
weighted.mean(NA, na.rm=TRUE)
and similar now returns
NaN
again, as it did prior to R 2.10.0.
R CMD
had a typo in its detection of whether the
environment variable TEXINPUTS was set (reported by Martin
Morgan).
strptime()
could corrupt its copy of the
timezone which would then lead to spurious warnings. (PR#14338)
dir.create(recursive = TRUE)
could fail if one of the
components existed but was a directory on a read-only file system.
(Seen on Solaris, where the error code returned is not even listed
as possible on the man page.)
postscript()
and pdf()
devices will now
allow lwd
values less than 1 (they used to force such
values to be 1).
pdf()
graphics output.
(PR#14326)
GERaster()
now checks for width or height of zero and
does nothing in those cases; previously the behaviour was
undefined, probably device-specific, and possibly dangerous.
wilcox.test(x, y, conf.int = TRUE)
failed with an unhelpful
message if x
and y
were constant vectors, and
similarly in the one-sample case. (PR#14329)
Recall()
from outside a function
could cause a segfault. (Reported by Robert McGehee.)
require(save = TRUE)
recorded the names of packages
it failed to load.
packageStatus()
could return a data frame with
duplicate row names which could then not be printed.
txtProgressBar(style = 2)
did not work correctly.
txtProgressBar(style = 3)
did not display until a
non-minimum value was set.
contour()
did not display dashed line types
properly when contour lines were labelled. (Reported by
David B. Thompson.)
tools::undoc()
again detects undocumented data
objects. Of course, this also affects R CMD check
.
ksmooth(x,NULL)
no longer segfaults.
approxfun()
, approx()
, splinefun()
and spline()
could be confused by x
values that
were different but so close as to print identically.
(PR#14377)
R CMD INSTALL
checks if dependent packages are
available early on in the installation of source packages,
thereby giving clearer error messages.
R CMD INSTALL --build
now names the file in the
format used for Mac OS X binary files on that platform.
BIC()
in package stats4 now also works with
multiple fitted models, analogously to AIC()
.
make
s on
case-insensitive file systems (although it currently works
with the recommended toolkits).
gnutar
is preferred to tar
when configure sets TAR. This is needed on Mac OS 10.6,
where the default tar
, bsdtar 2.6.2
, has been
reported to produce archives with illegal extensions to tar
(according to the POSIX standard).
mkCharLenCE
now no longer reads past
len
bytes (unlikely to be a problem except in user
code). (PR#14246)
utf8ToInt()
on long
multi-byte strings with many multi-byte characters. (PR#14262)
aggregate.ts()
gave platform-dependent results due to
rounding error for ndeltat != 1
.
package.skeleton()
sometimes failed to fix filenames
for ‘.R’ or ‘.Rd’ files to start with an alphanumeric.
(PR#14253)
It also failed when only an S4 class without any methods was defined. (PR#14280)
splinefun(method = "monoH.FC"
)
was not
quite monotone in rare cases. (PR#14215)
Rhttpd
no longer crashes due to SIGPIPE
when
the client closes the connection prematurely. (PR#14266)
format.POSIXlt()
could cause a stack overflow and
crash when used on very long vectors. (PR#14267)
Rd2latex()
incorrectly escaped special characters in
\usage sections.
mcnemar.test()
could alter the levels (dropping
unused levels) if passed x
and y
as factors
(reported by Greg Snow).
Rd2pdf
sometimes needed a further
pdflatex
pass to get hyperlinked pages correct.
interaction()
produced malformed results when levels were
duplicated, causing segfaults in split()
.
cut(d, breaks = <n>)
now also works for "Date"
or "POSIXt"
argument d
.
(PR#14288)
memDecompress()
could decompress incompletely rare
xz
-compressed input due to incorrect documentation of
xz utils
. (Report and patch from Olaf Mersmann.)
initialize()
methods for "matrix"
,
"array"
, and "ts"
have been fixed to call
validObject()
. (PR#14284)
R CMD INSTALL
now behaves the same way with or
without --no-multiarch on platforms with only one
installed architecture. (It used to clean the ‘src’
directory without --no-multiarch.)
[<-.data.frame
was not quite careful enough in
assigning (and potentially deleting) columns
right-to-left. (PR#14263)
rbeta(n, a, b)
no longer occasionally returns
NaN
for a >> 1 > b
. (PR#14291)
pnorm(x, log.p = TRUE)
could return NaN
not
-Inf
for x
near (minus for lower.tail=TRUE
)
the largest representable number.
LazyData
. (PR#14273)
textConnection()
did an unnecessary translation on
strings in a foreign encoding (e.g. UTF-8 strings on Windows) and
so was slower than it could have been on very long input strings.
(PR#14286)
tools::Rd2txt()
did not render poorly written Rd
files consistently with other renderers.
It computed widths of strings that would be print()
ed with
escapes incorrectly, for example in the computation of column
width for \tabular.
na.action()
did not extract the na.action
component as documented.
do.call()
ing NextMethod
in erronous ways no
longer segfaults. (PR#13487)
call switch .C .Fortran .Call .Externalall of which use positional matching for their first argument, and also some internal-use-only primitives.
quartz()
and not X11()
.
open
modes for connections are now interpreted
more consistently. open = "r"
is now equivalent to
open = "rt"
for all connections. The default open =
""
now means "rt"
for all connections except the
compressed-file connections gzfile()
, bzfile()
and
xzfile()
for which it means "rb"
.
R CMD INSTALL
now uses the internal untar()
function in package utils: this ensures that all platforms
can install bzip2
- and xz
-compressed
tarballs. In case this causes problems (as it has on some
Windows file systems when run from Cygwin tools) it can be
overridden by the environment variable R_INSTALL_TAR:
setting this to a modern external tar program will speed up
unpacking of large (tens of Mb or more) tarballs.
help(try.all.packages = TRUE)
is much faster
(although the time taken by the OS to find all the packages the
first time it is used can dominate the time).
R CMD check
has a new option --timings
to record per-example timings in file
‘<pkg>.Rcheck/<pkg>-Ex.timings’.
grep[l]
, [g]sub
and [g]regexpr
now work
in bytes in an 8-bit locales if there is no marked UTF-8 input
string: this will be somewhat faster, and for [g]sub()
give the result in the native encoding rather than in UTF-8
(which returns to the behaviour prior to R 2.10.0).
skipCalls
has been added to
browser()
so that it can report the original context when
called by other debugging functions.
agrep()
and the regular-expression matching functions.
gregexpr()
to
length(text) > 0
has been removed.
Cairo
,
RSvgDevice
, cairoDevice
) will need to be reinstalled.
There is also support in the graphics engine for capturing raster images from graphics devices (again not supported on all graphics devices).
R CMD check
now also checks if the package and
namespace can be unloaded: this provides a check of the
.Last.lib()
and .onUnload()
hook functions (unless
--install=fake).
prop.table(x)
now accepts a one-dimensional table for
x
.
vapply()
has been added, based on a
suggestion from Bill Dunlap. It requires that a template for the
function value be specified, and uses it to determine the output
type and to check for consistency in the function values.
[
method for class "AsIs"
allows the next
method to change the underlying class. (Wish of Jens
Oehlschlägel.)
write.csv[2]
no longer allow argument append
to be changed: as ever, direct calls to write.table()
give
more flexibility as well as more room for error.
.required
by require()
and
detach()
has been replaced by .Depends
which is set
from the Depends
field of a package (even in packages with
name spaces). By default detach()
prevents such
dependencies from being detached: this can be overridden by the
argument force
.
bquote()
has been extended to work on function
definitions. (Wish of
PR#14031).
detach()
when applied to an object other than a
package returns the environment that has been detached, to
parallel attach()
.
readline()
in non-interactive use returns ""
and does not attempt to read from the ‘terminal’.
file_ext()
in package tools.
xtfrm()
is now primitive and internally generic, as
this allows S4 methods to be set on it without name-space scoping
issues.
There are now "AsIs"
and "difftime"
methods, and
the default method uses unclass(x)
if is.numeric(x)
is true (which will be faster but relies on is.numeric()
having been set correctly for the class).
is.numeric(x)
is now false for a "difftime"
object (multiplication and division make no sense for such
objects).
weighted.mean(x, w)
coerces
w
to be numeric (aka double); previously only integer
weights were coerced. Zero weights are handled specially so an
infinite value with zero weight does not force an NaN
result.
There is now a "difftime"
method.
bug.report()
now has arguments package
and
lib.loc
to generate bug reports about packages. When
this is used, it looks for a BugReports
field in the
package ‘DESCRIPTION’ file, which will be assumed to be a
URL at which to submit the report, and otherwise generates an
email to the package maintainer. (Suggested by Barry
Rowlingson.)
quantile()
now has a method for the date-time class
"POSIXt"
, and types 1 and 3 (which never interpolate) work
for Dates and ordered factors.
length(<POSIXlt>)
now returns the length of the
corresponding abstract timedate-vector rather than always 9 (the
length of the underlying list structure). (Wish of PR#14073
and PR#10507.)
readline
completion backend no longer sorts
possible completions alphabetically (e.g., function argument
names) if R was built with readline >= 6
.
select.list()
gains a graphics
argument to
allow Windows/Mac users to choose the text interface. This
changes the behaviour of new.packages(ask=TRUE)
to be like
update.packages(ask=TRUE)
on those platforms in using a
text menu: use ask="graphics"
for a graphical menu.
chooseBioCmirror()
to set the
"BioC_mirror"
option.
name
in signatures of S4 methods for $
and $<-
, since
they will always be called with a character string value for
name
. The implicit S4 generic functions have been
changed to reflect this: packages which included name
in
the signature of their methods need to be updated and
re-installed.
method
argument of glm()
has been refined following suggestions by Ioannis Kosmidis and
Heather Turner.
str()
gains a new argument list.len
with
default 99, limiting the number of list()
items (per
level), thanks to suggestions from David Winsenius.
enc2native()
and enc2utf8()
convert character vectors with possibly marked encodings to the
current locale and UTF-8 respectively.
"warnEscapes"
is no longer needed. rawToChar()
now removes trailing nuls
silently, but other embedded nuls become errors.
strwrap()
instead of one object per line.
print.rle()
gains argument prefix
.
download.file()
gains a "curl"
method, mainly
for use on platforms which have curl
but not
wget
, but also for some hard-to-access URLs.
Rd
, \eqn and \deqn will render in
HTML (and convert to text) upper- and lower-case Greek letters
(entered as \alpha ...), \ldots, \dots,
\ge and \le.
utf8ToInt()
and intToUtf8()
now map NA
inputs
to NA
outputs.
file()
has a new argument raw
which may help
if it is used with something other than a regular file, e.g. a
character device.
strtoi()
, a wrapper for the C function
strtol
.
as.octmode()
and as.hexmode()
now allow inputs
of length other than one.
The format()
and print()
methods for
"octmode"
now preserve names and dimensions (as those for
"hexmode"
did).
The format()
methods for classes "octmode"
and
"hexmode"
gain a width
argument.
seq.int()
returns an integer result in some further cases
where seq()
does, e.g. seq.int(1L, 9L, by = 2L)
.
NA
indices are propagated to the
result. Unmatched values and ""
are not allowed and
result in an error.
interaction(drop=TRUE)
uses less memory (related to
PR#14121).
summary()
methods have been added to the
"srcref"
and "srcfile"
classes, and various
encoding issues have been cleaned up.
"checkPackageLicense"
is set to TRUE
(not
currently the default), users will be asked to agree to
non-known-to-be-FOSS package licences at first use.
setAs(a, b)
methods only gives a message
instead of a warning, when one of a
or b
is
unknown.
norm()
to compute a matrix norm.
norm()
and also backsolve()
and sample()
have implicit S4 generics.
R CMD check
now (by default) also checks Rd files
for auto-generated content in need of editing, and missing
argument descriptions.
aggregate()
gains a formula method thanks to a
contribution by Arni Magnusson. The data frame method now allows
summary functions to return arbitrarily many values.
path.expand()
now propagates NA
values rather
than converting them to "NA"
.
file.show()
now disallows NA
values for file names,
headers, and pager.
seq()
and seq.int()
has
been reduced from 1e-7
to 1e-10
, which should be
ample for the double-precision calculations used in R. It
ensures that the fuzz never comes into play with sequences of
integers (wish of PR#14169).
RSiteSearch(restrict=)
has been
changed to include vignettes but to exclude R-help. The R-help
archives available have been split, with a new option of
"Rhelp10"
for those from 2010.
rasterImage()
in the graphics
package for drawing raster images.
stats:::extractAIC.coxph()
now omits aliased terms
when computing the degrees of freedom (suggestion of Terry
Therneau).
cor()
and cov()
now test for misuse with
non-numeric arguments, such as the non-bug report PR#14207.
pchisq(ncp =, log.p = TRUE)
is more accurate for
probabilities near one. E.g. pchisq(80, 4, ncp=1,
log.p=TRUE)
. (Maybe what was meant in PR#14216.)
maintainer()
has been added, to give convenient
access to the name of the maintainer of a package (contributed by
David Scott).
sample()
and sample.int()
allow zero items to
be sampled from a zero-length input. sample.int()
gains a
default value size=n
to be more similar to
sample()
.
switch()
returned NULL
on error (not
previously documented on the help page): it now does so
invisibly, analogously to if-without-else.
It is now primitive: this means that argument EXPR
is
always matched to the first argument and there is no danger of
partial matching to later named arguments.
UseMethod()
, attr()
,
attr<-()
, on.exit()
, retracemem()
and
substitute()
now use standard argument matching (rather
than positional matching). This means that all multi-argument
primitives which are not internal now use standard argument
matching except where positional matching is desirable (as for
switch()
, call()
, .C()
...).
base::which()
uses a new .Internal
function
when arr.ind
is FALSE
resulting in a 10x speedup.
Thanks to Patrick Aboyoun for implementation suggestions.
outputEncoding = "ASCII"
uses the second part.
"listOfMethods"
has been introduced to
represent the methods in a methods table, to replace the
deprecated class "MethodsList"
.
any()
and all()
return early if possible.
This may speed up operations on long vectors.
strptime()
now accepts "%z"
(for the offset
from UTC in the RFC822 format of +/-hhmm
).
select.list()
(including menu()
and install.packages()
) now check
on a Unix-alike that Tk can be started (and not just
capabilities("tcltk") && capabilities("X11")
).
X11()
type is set to "Xlib"
: this avoids
several problems with font selection when done by cairo rather
than Pango (at least on Mac OS X).
arrayInd()
such that which(x,
arr.ind = TRUE)
for an array 'x' is now equivalent to
arrayInd(which(x), dim(x), dimnames(x))
.
stats::clearNames()
is defunct: use unname()
.
strsplit()
, grep()
, grepl()
, sub()
,
gsub()
, regexpr()
and gregexpr()
no longer
have an extended
argument.
methods::trySilent()
is defunct.
index.search()
(which was deprecated in 2.10.0) is no
longer exported and has a different argument list.
return()
is now defunct.
UseMethod()
with more than two arguments
is now defunct.
"MethodsList"
metadata objects which had been superseded by hash tables
(environments) since R 2.8.0 are being phased out. Objects of
this class are no longer assigned or used as metadata by the
package.
getMethods()
is now deprecated, with its internal use replaced
by findMethods()
and other changes. Creating objects from the
"MethodsList"
class is also deprecated.
configure
looks for a POSIX compliant
tr
, Solaris's /usr/ucb/tr
having been found
to cause Rdiff
to malfunction.
configure
is now generated with autoconf
2.65
, which works better on recent systems and on Mac OS X.
R CMD INSTALL
now tests that the installed package
can be loaded (and backs out the installation if it cannot): this
can be suppressed by --no-test-load. This avoids
installing/updating a package that cannot be used: common causes
of failures to load are missing/incompatible external software
and missing/broken dependent packages.
with()
, eval()
etc with a list with some
unnamed elements now works.
(PR#14035)
"quick"
dispatch of S4 methods for primitive
functions was not happening, forcing a search each time.
(Dispatch for closures was not affected.) A side effect is that
default values for arguments in a method that do not have
defaults in the generic will now be ignored.
findInheritedMethods()
.
Resources
directory was present at the
top level. Such a non-symlink will now be renamed to
Resources.old
(and anything previously named
Resources.old
removed) as part of the framework
installation process.
...
). Arguments omitted
from the method definition but conforming (per the documentation)
should now be ignored (treated as "ANY"
) in dispatching.
...
was in the signature could fail, treating ...
as an
ordinary symbol. This has been fixed, for the known cases.
ar()
fitting methods have more protection for
singular fits.
callNextMethod
now works again with the drop=
argument in [
parse()
and parse_Rd()
miscounted columns when
multibyte UTF-8 characters were present.
cor(A, B)
where A
is n x 1
and B
a 1-dimensional array segfaulted or gave an internal
error. (The case cor(B, A)
was
PR#7116.)
cut.POSIXt()
applied to a start value after the DST
transition on a DST-change day could give the wrong time for
argument breaks
in units of days or longer. (PR#14208)
do_par()
UNPROTECT
ed too early (PR#14214)
x[[....]] <- y
didn't check for a
zero-length right hand side, and inserted a rubbish
value. (PR#14217)
fisher.test()
no longer gives a P-value very
slightly > 1, in some borderline cases.
matchArgs()
no longer modifies the
general purpose bits of the SEXP
s that make up the formals
list of R functions. This fixes an invalid error message that
would occur when a garbage collection triggered a second call to
matchArgs for the same function via a finalizer.
gsub()
in 2.10.x could fail from stack overflow for
extremely long strings due to temporary data being allocated on
the stack. Also, gsub()
with fixed=TRUE
is in some
circumstances considerably faster.
attributes()
,
attr<-()
interactive()
, nargs()
and
proc.time()
, did not check that they were called with the
correct number of arguments.
list.files()
when other
processes are operating on the directory has been fixed; the code
now dynamically allocates memory for file listings in a single
pass instead of making an initial count pass.
mean(x, trim=, na.rm = FALSE)
failed to return NA
if
x
contained missing values. (Reported by Bill Dunlap.)
pbeta()
{and hence
pf()
}, e.g., pbeta(x, 3, 2200, lower.tail=FALSE,
log.p=TRUE)
now returns finite values instead of jumping to
-Inf
too early. (PR#14230).
parse(text=x)
misbehaved for objects x
that
were not coerced internally to character, notably symbols.
(Reported to R-devel by Bill Dunlap.)
coerceSymbol
now handles
coercion to character, and warns if coercion fails (rather than
silently returning NULL
). This allows a name to be given
where a character vector is required in functions which coerce
internally.
strptime()
of "%c"
was
non-standard (not that it is ever advisable to use locale- and
system-specific input formats).
"X11"
) now works the same way on Mac OS X as on
other platforms (and as documented: it was always true for R
built with --with-aqua, as the CRAN builds are).
X11()
device with cairo but not Pango (notably Mac OS X)
now checks validity of text strings in UTF-8 locales (since
Pango does but cairo it seems does not).
read.fwf()
misread multi-line records when n was specified.
(PR#14241)
all.equal(tolerance = e)
passes the numeric
tolerance also to the comparison of the attributes.
pgamma(0, 0)
, a boundary case, now returns 0, its
limit from the left, rather than the limit from the right.
POST
requests to the internal web server could stall
the request under certain circumstances.
gzcon( <textConnection> )
, an error, no longer
damages the connection (in a way to have it
segfault). (PR#14237)
hist()
now use the nominal
breaks
not those adjusted by the numeric ‘fuzz’:
in recent versions the nominal breaks
were reported but
the 'density' referred to the intervals used in the calculation
– which mattered very slightly for one of the extreme bins.
(Based on a report by Martin Becker.)
xy[z].coords
(used internally by many graphics
functions) are given a list as x
, they now check that
the list has suitable names and give a more informative error
message. (PR#13936)
postscript()
and
pdf()
devices was set up for round end caps (the only type
which existed at the time): it has now been adjusted for butt
endcaps.
lchoose(a, k)
is now defined as
log(abs(choose(a,k)))
, analogously to lfactorial()
.
\eqn{}
in Rd files is defined as a
‘verbatim’ macro, many packages expected \dots
and
\ldots
to be interpreted there (as was the case in R <
2.10.0), so this is now done (using an ellipsis in HTML
rendering).
tools::readNEWS()
now accepts a digit as the first
character of a news section.
read.table(header=TRUE)
on a header with an
embedded new line would copy part of the header into the data.
(PR#14103)
qpois(p = 1, lambda = 0)
now gives 0 as for all other
p
. (PR#14135)
unique()
, match()
) could cause crashes when
used with strings not in the native encoding, e.g. UTF-8 strings
on Windows. (PR#14114 and PR#14125)
x[ , drop=TRUE]
dropped an NA
level even if it
was in use.
tools::codoc()
(used by R CMD check
) was
missing cases where the function had no arguments but was
documented to have some.
"?"
)
were not generated correctly when rendered in
HTML. (PR#14155)
lchoose(a, k)
no longer wrongly gives NaN
for
negative a
.
ks.test()
could give a p-value that was off by one
observation due to rounding error. (PR#14145)
readBin()
/readChar()
when reading millions of
character strings in a single call used excessive amounts of
memory (which also slowed them down).
R CMD SHLIB
could fail if used with paths that
were not alphanumeric, e.g. contained +
. (PR#14168)
sprintf()
was not re-entrant, which potentially
caused problems if an as.character()
method called it.
quartz()
device did not restore the clipping
region when filling the background for a new page. This could be
observed in multi-page bitmap output as stale outer regions of
the plot.
p.adjust(method, n)
now works correctly for the
rare case n > length(p)
, also when method differs from
"bonferroni"
or "none"
, thanks to a patch from
Gordon Smyth.
tools::showNonASCII()
failed to detect non-ASCII characters
if iconv()
(incorrectly) converted them to different ASCII
characters. (Seen on Windows only.)
tcrossprod()
wrongly failed in some cases when one of the
arguments was a vector and the other a matrix.
[cr]bind(..., deparse.level=2)
was not always giving
names when documented to do so. (Discovered whilst investigating
PR#14189.)
match(incomparables=<non-NULL>)
could in rare cases
infinite-loop.
poisson.test()
needed to pass argument
conf.level
to binom.test()
. (PR#14195)
"nls"
method for df.residual()
gave
incorrect results for models fitted with na.action =
na.exclude
. (PR#14194)
options(scipen=)
was only implemented
when printing next occurred, even though it should have affected
intervening calls to axis()
, contour()
and
filledcontour()
.
prettyNum(drop0trailing=TRUE)
did not handle signs of
imaginary parts of complex numbers correctly (and this was used
by str()
: PR#14201).
system.time()
had the sys.child
component
wrong (copied user.child
instead) on systems with
HAVE_GETRUSAGE
.
(PR#14210)
bitmap()
and
dev2bitmap()
with the "pdfwrite"
device was not
working correctly.
plot(ecdf(), log="x")
no longer gives an incorrect
warning.
read.fwf()
works again when argument file
is
a connection.
contrasts<-
(in the stats package) no longer has an
undeclared dependence on methods (introduced in 2.10.0).
R CMD INSTALL
has new options --no-R,
--no-libs, --no-data, --no-help,
--no-demo, --no-exec, and --no-inst to
suppress installation of the specified part of the package.
These are intended for special purposes (e.g. building a database
of help pages without fully installing all packages).
parse(file="")
(which previously had a limit of around 1024 bytes).
setRepositories()
via the option "BioC_mirror"
,
e.g. the European mirror can be selected by
options(BioC_mirror="http://bioconductor.statistik.tu-dortmund.de")
.
tk_select.list()
list box now
selects the item and closes the list box (as happens on the
Windows select.list()
widget).
configure
will be able to find a usable
libtiff
in some rare circumstances where it did not
previously (where libtiff
needed to be linked explicitly against
-ljpeg
).
refman.pdf
works around a problem with the indexing
with hyperref 6.79d
and later.
extended
argument is deprecated in
strsplit()
, grep()
, grepl()
, sub()
,
gsub()
, regexpr()
and gregexpr()
(not just
the value extended = FALSE
) and will be removed in R
2.11.0.
trigamma(x)
and other psigamma(x, n)
calls
are now accurate for very large abs(x)
. (PR#14020)
[g]sub(perl=FALSE, fixed=FALSE)
could use excessive
stack space when used with a very long vector containing some
non-ASCII strings.
weighted.mean(na.rm = TRUE)
did not omit weights for NA
observations in 2.10.0.
(PR#14032)
[g]regexpr(pattern, fixed = TRUE)
returned match
positions in bytes (not characters) in an MBCS locale if
pattern
was a single byte.
[g]sub(fixed = TRUE)
with a single-byte pattern could
conceivably have matched part of a multibyte character in a
non-UTF-8 MBCS.
findLineNum()
and setBreakpoint()
would
sometimes fail if the specified file was not in the current
directory.
demo(tkdensity)
was broken in
2.9.0 when demo()
was changed to set par(ask = TRUE)
.
gsub()
with backrefs could fail on extremely long strings
(hundreds of thousands of characters) due to integer overflow
in a length calculation.
abline(untf=TRUE)
now uses a better x-grid in
log-scale, e.g., for plot(c(1,300), c(1,300), log="xy");
abline(4,1, untf=TRUE)
.
detach()
/unloadNamespace()
arrange to flush
the package's lazyload cache of R objects once the
package/namespace is no longer needed.
\command
is now rendered verbatim (so e.g. --
is not interpreted, PR#14045).
Also, there are many small changes to help files where the new converters were not rendering them in the same way as before.
available.packages()
would fail when run on a
repository with no packages meeting the filtering conditions.
(PR#14042)
rep(x, times, each = 2)
gave invalid results when the
times
argument was a vector longer than x
.
Reported by Bill Dunlap.
unloadNamespace()
attempted to run the
.onUnload()
function gave an error in the reporting
function and so was not reported properly.
promptMethods()
generated signature documentation
improperly.
pgamma(x, a, lower.tail=FALSE)
and
qgamma(...)
are now considerably more accurate in some
regions for very small a
. qgamma()
now correctly
returns 0
instead of NaN
in similar extreme cases,
and qgamma()
no longer warns in the case of small
a
, see (PR#12324).
unname()
now also removes names from a zero length vector.
ls.str()
no longer evaluates
unevaluated calls.
complete.cases()
failed on a 0-column data frame
argument. (Underlies PR#14066.)
It could return nonsensical results if no input determined the number of cases (seen in the no-segfault tests).
nls()
with a long formula could cause a
segfault. (PR#14059)
qchisq(p, df, ncp, lower.tail = FALSE)
with
ncp >= 80
was inaccurate for small p
(as the help page
said): it is now less inaccurate. (In part,
PR#13999.)
For ncp
less than but close to 80, pchisq()
and
qchisq()
are more accurate for probablilities very close
to 1 (a series expansion was truncated slightly too early).
pchisq(x, df, ncp)
can no longer return values just larger
than one for large values of ncp
.
intToUtf8()
could fail when asked to produce 10Mb or more
strings, something it was never intended to do: unfortunately
Windows crashed R (other OSes reported a lack of resources).
(PR#14068)
chisq.test()
could fail when given argument
x
or y
which deparsed to more than one line.
(Reported by Laurent Gauthier.)
unloadNamespace()
as well as by
detach(unload = TRUE))
.
dyn.load
/dyn.unload
was incomplete, which could
crash R if a DLL that registered .External
routines had
earlier been unloaded.
bessel[JY](x, nu)
with nu
a negative integer (a
singular case) is now correct, analogously to besselI()
,
see PR#13556.
tools::file_path_as_absolute()
doubled the file
separator when applied to a file such as ‘"/vmunix"’ or (on
Windows) ‘"d:/afile"’ in a directory for which
getwd()
would return a path with a trailing separator
(largely cosmetic, as reasonable file systems handle such a path
correctly). (Perhaps what was meant by PR#14078.)
unsplit(drop = TRUE)
applied to a data frame failed
to pass drop
to the computation of row names. (PR#14084)
"difftime"
method of mean()
ignored its
na.rm
argument.
tcltk::tk_select.list()
is now more likely to remove the
widget immediately after selection is complete.
"difftime"
object to/from a
"POSIXt"
or "Date"
object works again (it was
broken by the addition of Ops.difftime
).
wilcox.test(conf.int=TRUE)
has achieved.level
corrected and, for exact=FALSE
, now returns a
estimate
component which does not depend on the
alternative used.
help.search()
failed when the package argument was
specified. (PR#14113)
switch(EXPR = "A")
now returns NULL
, as does
switch(1)
(which used to signal an error).
Rd
by the R-based
converters that were first introduced in 2.9.0. This means
help.start()
and HTML help (so text help is shown
instead).
help.search()
. help.start()
no
longer has an argument searchEngine
as it is no longer
needed.
\link[pkg]{foo}
and \link[pkg:foo]{bar}
where foo
is an alias in the package, rather than the
documented (basename of a) filename (since the documentation
has been much ignored).
polygon()
, pdf()
and postscript()
now
have an argument fillOddEven
(default FALSE
),
which controls the mode used for polygon fills of
self-intersecting shapes.
debugonce()
function; further,
getOption("deparse.max.lines")
is now observed when
debugging, from a code suggestion by John Brzustowski.
(PR#13647/8)
plot()
methods for "stepfun"
and hence
"ecdf"
no longer plot points by default for n >= 1000
.
[g]sub(perl=TRUE)
now also supports "\E"
in order to end "\U"
and "\L"
case changes,
thanks to a patch from Bill Dunlap.
factor()
, levels()<-
, etc, now ensure that
the resulting factor levels are unique (as was always the implied
intention). Factors with duplicated levels are still
constructible by low-level means, but are now declared illegal.
print()
(S3) method for class "function"
,
also used for auto-printing. Further, .Primitive
functions now print and auto-print identically. The new method
is based on code suggestions by Romain François.
print()
and toLatex()
methods for class
"sessionInfo"
now show the locale in a nicer format and
have arguments to suppress locale information.
round()
, there are
other Math
group (S3) methods for "difftime"
,
such as floor()
, signif()
, abs()
, etc.
old.packages()
and
available.packages()
allow arguments type
to be
specified (you could always specify arguments available
or contriburl
).
available.packages()
by default only returns
information on the latest versions of packages whose version
requirements are satisfied by the currently running R.
tools::write_PACKAGES()
has a new argument
latestOnly
, which defaults to TRUE
when only the
latest versions in the repository will be listed in the index.
getOption()
has a new argument default
that
is returned if the specified option is not set. This simplifies
querying a value and checking whether it is NULL
or not.
parse()
now warns if the requested encoding is not supported.
"table"
method of as.data.frame()
gains a
stringsAsFactors
argument to allow the classifying
factors to be returned as character vectors rather than the
default factor type.
model.frame.default()
encounters a character
variable where xlev
indicates a factor, it now converts
the variable to a factor (with a warning).
curve()
now returns a list containing the points that
w§ere drawn.
spineplot()
now accepts axes = FALSE
, for
consistency with other functions called by plot.factor()
.
cor.test()
can
optionally use continuity correction when not computing exact
p-values. (The Kendall case is the wish of PR#13691.)
options(keep.source = TRUE)
. The source
reference is displayed by debugging functions such as
traceback()
, browser()
, recover()
, and
dump.frames()
, and is stored as an attribute on each
element returned by sys.calls()
.
quantile.default()
now disallows factors (wish of
PR#13631) and its help
documents what numeric-like properties its input need to have to
work correctly.
weighted.mean()
is now generic and has "Date"
,
"POSIXct"
and "POSIXlt"
methods.
x[i=1, j=2]
) in
data.frame
methods for [
and [[
now gives a
warning. (Names are ignored in the default method, but could
have odd semantics for other methods, and do for the data.frame
ones.)
as.data.frame()
has an "aovproj"
method.
(Wish of PR#13505)
as.character(x)
for numeric x
no longer
produces strings such as "0.30"
, i.e., with trailing
zeros. This change also renders levels construction in
factor()
more consistent.
codocClasses()
, which checks consistency of the
documentation of S4 class slots, now does so in considerably more
cases. The documentation of inherited slots (from superclasses)
is now optional. This affects R CMD check <pkg>
when
the package defines S4 classes.
codoc()
now also checks S4 methods for code/documentation
mismatches.
for()
, while()
, and repeat()
loops now
always return NULL as their (invisible) value. This change was
needed to address a reference counting bug without creating
performance penalties for some common use cases.
print()
method for ls.str()
results now
obeys an optional digits
argument.
method
argument of glm()
now allows
user-contributed methods.
reorder.default()
replaces functionality of
reorder.factor()
and reorder.character()
.
aspell()
has been added to provide an
interface to the Aspell
spell-checker.
RdTextFilter()
and SweaveTeXFilter()
have been added to the tools package to provide support for
aspell()
or other spell checkers.
xtabs()
with the new argument sparse = TRUE
now returns a sparse Matrix, using package Matrix.
contr.sum()
etc gain an argument sparse
which allows sparse matrices to be returned.
contrasts()
also gains a sparse
argument which it
passes to the actual contrast function if that has a formal
argument sparse
.
contrasts(f, .) <- val
now also works when val
is a sparse Matrix. It is planned that model.matrix()
will work with such factors f
in the future.
readNEWS()
will recognize a UTF-8 byte-order mark
(BOM) in the ‘NEWS’ file. However, it is safer to use only
ASCII code there because not all editors recognize BOMs.
inheritedSlotNames()
for S4
class programming.
tabulate()
now allows NAs to pass through (and be ignored).
debug()
is called on an S3 generic function then
all methods are debugged as well.
boxplot()
now obey the
outlwd
argument. Reported by Jurgen Kluge.
svd(x)
and eigen(x)
now behave analogously to
qr(x)
in accepting logical matrices x
.
Emacs
local variables
set for UTF-8 at the end. RShowDoc("NEWS")
should display
this correctly, given suitable fonts.
terms.formula(simplify = TRUE)
now does not deparse
the LHS and so preserves non-standard responses such as `a:
b`
(requested by Sundar Dorai-Raj).
news()
for building and querying R or
package news information.
z^n
for integer n
and complex z
is more
accurate now if |n| <= 65536
.
factor(NULL)
now returns the same as
factor(character(0))
instead of an error, and
table(NULL)
consequently does analogously.
as.data.frame.vector()
(and its copies) is slightly faster
by avoiding a copy if there are no names (following a
suggestion of Tim Hesterberg).
writeLines()
, writeBin()
and
writeChar()
have a new argument useBytes
. If
false, character strings with marked encodings are translated to
the current locale (as before) but if true they are written
byte-by-byte.
iconv()
has a new argument mark
which can be
used (by experts) to suppress the declaration of encodings.
LinkingTo
specs are now
recognized as installation dependencies, and included in package
management computations.
License
specs
are now available for package management computations.
"\uxxxx"
and "\Uxxxxxxxx"
escapes can now be
parsed to a UTF-8 encoded string even in non-UTF-8 locales (this
has been implemented on Windows since R 2.7.0). The semantics
have been changed slightly: a string containing such escapes is
always stored in UTF-8 (and hence is suitable for portably
including Unicode text in packages).
as.raw()
method for "tclObj"
objects (wish
of PR#13758).
Rd.sty
now makes a better job of setting email addresses,
including using a monospaced font.
textConnection()
gains an encoding
argument
to determine how input strings with marked encodings will be
handled.
R CMD Rd2pdf
is available as a shortcut for
R CMD Rd2dvi --pdf
.
R CMD check
now checks links where a package is
specified (\link[pkg]{file}
or
\link[pkg:file]{topic}
), if the package is available.
It notes if the package is not available, as in many cases this
is an error in the link.
identical()
gains three logical arguments, which
allow for even more differentiation, notably -0
and
0
.
legend()
now can specify the border
color of
filled boxes, thanks to a patch from Frederic Schutz.
[[ ]]
has now been
extended to all recursive types.
[[<-
didn't support assigning them.)
#line
directives, so error messages and source references may refer to
the original file rather than an intermediate one.
findLineNum()
and
setBreakpoint()
work with the source references to find
the location of source lines and set breakpoints (using
trace()
) at those lines.
detach()
now has an argument character.only
with the same meaning as for library()
or
require()
.
available.packages()
gains a filters
argument for specifying the filtering operations performed on the
packages found in the repositories. A new built-in
"license/FOSS"
filter only retains packages for which
installation can proceed solely based on packages which can be
verified as Free or Open Source Software (FOSS) employing the
available license specifications.
setOldClass()
, the data part (e.g., the object type)
required for the class can be included as one of the superclasses
in the Classes argument.
f
to showMethods()
can be an
expression evaluating to a generic function, allowing methods to
be shown for non-exported generics and other nonstandard cases.
sprintf()
now supports %o
for octal
conversions.
Sys.readlink()
for information about symbolic
links, including if a file is a symbolic link.
checkRdaFiles()
and resaveRdaFiles()
to report on
the format of ‘.rda’/‘.RData’ data files, and to
re-save them in a different compressed format, including choosing
the most compact format available.
A new INSTALL
option, --resave-data, makes use
of this.
arrows()
and segments()
allow one of x1
or y1
to be omitted to simplify the specification of
vertical or horizontal lines (suggestion of Tim Hesterberg).
approxfun()
is faster by avoiding repeated NA
checks (diagnosis and patch by Karline Soetaert & Thomas
Petzoldt).
stripchart()
allows par
bg
to be
passed in for the background colour for pch = 21
(wish of
PR#13984).
.DollarNames()
to enable class authors
to customize completion after the $
extractor.
load()
, save()
, dput()
and
dump()
now open a not-yet-open connection in the
appropriate mode (as other functions using connections directly
already did).
This is often faster, especially in a MBCS locale.
Some known differences are that it is less tolerant of invalid
inputs in MBCS locales, and in its interpretation of undefined
(extended) regexps such as "^*"
. Also, the interpretation of
ranges such as [W-z]
in caseless matching is no longer to map
the range to lower case.
This engine may in future be used in ‘literal’ mode for
fixed = TRUE
, and there is a compile-time option in
src/main/grep.c
to do so.
gsub()
and
gregexpr()
as warned about in the help page does not work
in this engine (it did in the previous one since 2005).
fixed = TRUE
and perl = TRUE
, including
useBytes
and support for UTF-8-encoded strings in
non-UTF-8 locales.
agrep()
now has full support for MBCS locales with a modest
speed penalty. This enables help.search()
to use approximate
matching character-wise rather than byte-wise.
[g]sub
use a single-pass algorithm instead of
matching twice and so is usually faster.
perl = TRUE
versions now work correctly in a
non-UTF-8 MBCS locale, by translating the inputs to UTF-8.
useBytes = TRUE
now inhibits the translation of inputs with
marked encodings.
strsplit()
gains a useBytes
argument.
strsplit()
has been reordered
to batch by elements of split
: this can be much faster for
fixed = FALSE
(as multiple compilation of regexps is avoided).
?regexp
, have been updated
and should be consulted for details of the new implementations.
tools::startDynamicHelp()
. With this enabled,
HTML help pages will be generated on request, resolving links
by searching through the current .libPaths()
. The user
may set options("help.ports"
) to control which IP port is used
by the server.
help.start()
no longer sets options(htmlhelp =
TRUE)
(it used to on Unix but not on Windows). Nor does it on
Unix reset the "browser"
option if given an argument of
that name.
Arguments update
and remote
are now available
on all platforms: the default is update = FALSE
since the
http server will update the package index at first use.
help()
has a new argument help_type
(with
default set by the option of that name) to supersede arguments
offline
, htmlhelp
and chmhelp
(although for now they still work if help_type
is
unset). There is a new type, "PDF"
to allow offline PDF
(rather than PostScript).
A function offline_help_helper()
will be used if this exists
in the workspace or further down the search path, otherwise
the function of that name in the utils name space is used.
\Sexpr
has been added to Rd
files, to evaluate expressions at build, install, or render time.
Currently install time and render time evaluation are supported.
\if
, \ifelse
and \out
have been
added to allow format-specific (or more general, using
\Sexpr
) conditional text in man pages.
parse_Rd()
parser has been made more tolerant of coding
errors in Rd files: now all syntax errors are reported as
warnings, and an attempt is made to continue parsing.
parse_Rd()
now has an argument fragment
(default FALSE
) to accept small fragments of Rd files (so
that \Sexpr
can output Rd code which is then parsed).
parse_Rd()
now always converts its input to UTF-8.
The Rd2*
rendering functions have a new argument,
outputEncoding
, which controls how their output is
encoded.
parse_Rd()
no longer includes the newline as part of
a "%"
-style comment.
Rd2HTML
, Rd2latex
, Rd2txt
,
and Rd2ex
.
All example files are now created with either ASCII or UTF-8 encoding, and the encoding is only marked in the file if there is any non-UTF-8 code (previously it was marked if the help file had non-ASCII contents, possibly in other sections).
print.Rd()
now adds necessary escape characters so that
printing and re-parsing an Rd object should produce an
equivalent object.
parse_Rd()
was incorrectly handling multiple backslashes in
R code strings, converting 4n+3 backslashes to 2n+1 instead
of 2n+2.
parse_Rd()
now recognizes the \var
tag within
a quoted string in R-like text.
parse_Rd()
now treats the argument of
\command
as LaTeX-like, rather than verbatim.
untar()
to list or unpack tar archives,
possibly compressed. This uses either an external tar
command or an internal implementation.
tar()
to create (possibly compressed)
tar archives.
memCompress()
and
memDecompress()
for in-memory compression and
decompression.
bzfile()
has a compress
argument to select
the amount of effort put into compression when writing.
xzfile()
for use with
xz
-compressed files. (This can also read files
compressed by some versions of lzma
.)
gzfile()
looks at the file header and so can now also
read bzip2
-ed files and xz
-compressed files.
save(compress = "bzip2")
and "xz"
to use bzip2
or xz
compression (which will be slower, but can give substantially
smaller files). Argument compression_level
gives finer
control over the space/time tradeoffs.
load()
can read such saves (but only as from this version of R).
R CMD INSTALL
/check
and
tools::writePACKAGES
accept a wider range of compressed
tar archives. Precisely how wide depends on the capabilities of
the host system's tar
command: they almost always
include .tar.bz2
archives, and with modern versions of
tar
other forms of compression such as lzma
and xz
, and arbitrary extensions.
R CMD INSTALL
has a new option
--data-compress to control the compression used when
lazy-loading data. New possibilities are
--data-compress=bzip2 which will give ca 15% better
compression at the expense of slower installation times, and
--data-compress=xz, often giving even better compression
on large datasets at the expense of much longer installation
times. (The latter is used for the recommended packages: it is
particularly effective for survival.)
file()
for open = ""
, "r"
or
"rt"
will automagically detect compressed files (from
gzip
, bzip2
or xz
). This means
that compressed files can be specified by file name (rather than
via a gzfile()
connection) to read.table()
,
readlines()
, scan()
and so on.
data()
can handle compressed text files with extensions
‘.{txt,tab,csv}.{gz,bz2,xz}’ .
png(type="cairo1")
is defunct: the value is no longer
recognized.
tools::Rd_parse()
is defunct (as this version of R
uses only Rd version 2).
help()
arguments offline
, htmlhelp
and
chmhelp
are deprecated in favour of help_type
.
clearNames()
(in package stats) is deprecated
for unname()
.
extended = FALSE
) are
deprecated in strsplit
, grep
and friends. There is
a precise POSIX standard for them, but it is not what recent RE
engines implement, and it seems that in almost all cases package
authors intended fixed = TRUE
when using extended =
FALSE
.
methods::trySilent()
is deprecated in favour of
try(silent=TRUE)
or – more efficiently and flexibly –
something like tryCatch(error = function(e) e)
.
index.search()
is deprecated: there are no longer
directories of types other than help
.
iconv()
is now required: support for
configure option --without-iconv has been withdrawn (it
was deprecated in R 2.5.0).
R CMD build
, check
,
Rprof
and Sd2d
currently require it.
glob
function is now essential (a working
Sys.glob()
has been assumed since R 2.9.0 at least).
tar
capable of automagically
detecting compressed archives is useful for
utils::untar()
, and so gtar
(a common name for
GNU tar
) is preferred to tar
: set environment
variable TAR to specify a particular tar
command.
po/README
and ‘Writing R Extensions’.
There is support for the use of dngettext
for C-level
translations in packages: see ‘Writing R Extensions’.
DF[, "foo"] <- value
now works in most cases (by filling
with NA
s) or fails. (It used to give a corrupt data
frame.)
validObject()
avoids an error during evaluation in the case
of various incorrect slot definitions.
n:m
now returns a result of type "integer"
in
a few more boundary cases.
zap.ind
argument to printCoefmat()
did
not usually work as other code attempted to ensure that non-zero
values had a non-zero representation.
printCoefmat()
formatted groups of columns together,
not just the cs.ind
group but also the zap.ind
group and a residual group. It now formats all columns except
the cs.ind
group separately (and zaps the zap.ind
group column-by-column). The main effect will be see in the
output from print.anova()
, as this grouped SS-like columns
in the zap.ind
group.
R_ReplDLLinit()
initializes the top-level jump so
that some embedded applications on Windows no longer crash on
error.
identical()
failed to take the encoding of character
strings into account, so identical byte patterns are not
necessarily identical strings, and similarly Latin-1 and UTF-8
versions of the same string differ in byte pattern.
methods(f)
used to warn unnecessarily for an S4
generic f
which had been created based on an existing S3
generic.
"array"
).
NA
s could cause a segfault. Reported by Hervé
Pagès.
Rscript
could segfault if (by user error) its
filename argument was missing. Reported by Martin Morgan.
getAnywhere()
(and functions that use it, including argument
completion in the console) did not handle special built-in
functions. Reported by Romain Francois.
order()
was missing a PROTECT()
call and so
could segfault when called on character data under certain (rare)
circumstances involving marked non-native encodings.
prettyNum(z, drop0trailing=TRUE)
did not work
correctly when z
was a complex vector. Consequently,
str(z, ...)
also did not. (PR#13985)
make distclean
removed too many files in
etc/
if builddir = srcdir.
R CMD
replaced TEXINPUTS
rather than
appending to it (as documented and intended).
help.start()
no longer fails on unix when
"browser"
is a function.
pbeta(x, ..., log.p = TRUE)
is sometimes more accurate,
e.g., for very small x
.
CHARSXP
cache.