/
NEWS
3058 lines (2354 loc) · 134 KB
/
NEWS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
pqR News
CHANGES IN VERSION RELEASED 2017-06-09:
INTRODUCTION:
o pqR now uses a new garbage collector and new schemes for memory
layout. Objects are represented more compactly, much more
compactly if ``compressed pointers'' are used. Garbage collection
is faster, and will have a more localized memory access/write
pattern, which may be of significance for cache performance and
for performance with functions like mclapply from the parallel
package.
The new garbage collection scheme uses a general-purpose
Segmented Generational Garbage Collector, the source code for
which is at https://gitlab.com/radfordneal/sggc
INSTALLATION:
o There is now an --enable-compressed-pointers option to configure.
When included, pqR will be built with 32-bit compressed pointers,
which considerably reduces memory usage (especially if many small
objects are used) on a system with 64-bit pointers (slightly on a
system with 32-bit pointers). Use of compressed pointers results
in a speed penalty on some tasks of up to about 30%, while on
other tasks the lower memory usage may improve speed.
o There is now an --enable-aux-for-attrib option to configure.
This is ignored if --enable-compressed-pointers is used, or if
the platform does not use 64-bit pointers. Otherwise, it results
in attributes for objects being stored as ``auxiliary
information'', which allows for some objects to be stored more
compactly, with some possible speed and memory advantages, though
some operations become slightly slower.
o Packages containing C code must be installed with a build of pqR
configured with the same setting of --enable-compressed-pointers
or --enable-aux-for-attrib as the build of pqR in which they are
used.
o The --enable-strict-barrier option to configure has been removed.
In pqR, usages in C code such as CAR(x)=y cause compile errors
regardless of this option, so it is not needed for that purpose.
The use of this option to enable the PROTECTCHECK feature will be
replaced by a similar feature in a future pqR release.
DOCUMENTATION AND FEATURE CHANGES:
o Documentation in the ``R Installation and Administration'',
``Writing R Extensions'', and ``R Internals'' manuals has been
updated to reflect the new garbage collection and memory layout
schemes. There are also updates to help(Memory),
help("Memory-limits"), and help(gc).
o The format of the output of gc has changed, to reflect the
characteristics of the new garbage collector. See help(gc) for
details.
o Memory allocated by a C function using R_alloc will no longer
appear in output of Rprofmem.
o The pages argument for Rprofmem is now ignored.
o The output of .Internal(inspect(x)) now includes both the
uncompressed and the compressed pointers to x, and other
information relevant to the new scheme, while omitting some
information that was specific to the previous garbage collector.
CHANGES TO THE C API:
o The SETLENGTH function now performs some checks to avoid possible
disaster. Its use is still discouraged.
o The probably never-used call_R and call_S functions have been
disabled.
o It is now illegal to set the ``internal'' value associated with a
symbol to anything other than a primitive function (BUILTINSXP or
SPECIALSXP type). The INTERNAL values are no longer stored in
symbol objects, but in a separate table, with the consequence
that it may not be possible to use SET_INTERNAL for a symbol that
was not given an internal value during initialization.
o Passing a non-vector object to a C function using .C is now even
less advisable than before. If compressed pointers are used,
this will work only if the argument is recevied as a void*
pointer, then cast to uintptr_t, then to SEXP (this should work
when SEXP is either a compressed an uncompressed pointer).
BUG FIXES:
o Cross-references between manuals in doc/manual, such as
R-admin.html and R-exts.html, now go to the other manuals in the
same place. Previously (and in current R core versions), they
went to the manuals of that name at cran.r-project.org, even when
those manuals are not for the same version of R.
CHANGES IN VERSION RELEASED 2016-10-24:
INTRODUCTION:
o This is a small maintenance release, fixing a few bugs and
installation problems.
INSTALLATION:
o When building pqR on a Mac, some Mac-specific source files are
now compiled with the default 'gcc' (really clang on recent
Macs), regardless of what C compiler has been specified for other
uses. This is necessary to bypass problems with Apple-supplied
header files on El Capitan and Sierra. There are also a few other
tweaks to building on a Mac.
BUG FIXES:
o Some bugs have been fixed involving the interaction of finalizers
and active bindings with some pqR optimizations, one of which
showed up when building with clang on a Mac.
CHANGES IN VERSION RELEASED 2016-10-05:
INTRODUCTION:
o With this release, pqR, which was based on R-2.15.0, now
incorporates the new features, bug fixes, and some relevant
performance improvements from R-2.15.1. The pqR version number
has been advanced to 2.15.1 to reflect this. (This version
number is checked when trying to install packages.)
Note that there could still be incompatibilities with packages
that work with R-2.15.1, either because of bugs in pqR, or
because a package may rely on a bug that is fixed in pqR, or
because pqR implements some changes from R Core versions after
R-2.15.1 that are not compatibile with R-2.15.1, or because some
new pqR features are not totally compatible with R-2.15.1.
Since many features from later R Core versions are also
implemented in pqR, some packages that state a dependence on a
later version of R might nevertheless work with pqR, if the
dependence declaration in the DESCRIPTION file is changed.
o The 'digest' package (by Dirk Eddelbuettel and others) is now
included in the release as a recommended package (which will
therefore be available without having to install it). The
version used is based on digest_0.6.10, with a slight
modification to correctly handle pqR's constant objects (hence
called digest_0.6.10.1).
o The pqR package repository (see information at pqR-project.org)
has now been updated to include some packages (or new versions of
packages) that depend on R-2.15.1, which were previously not
included.
o There are also some new pqR features and performance improvements
in this release, including across and down options for for
statements, a less error-prone scheme for protecting objects from
garbage collection in C code, and faster implementations of
subset replacement with [ ], [[ ]], and $.
INSTALLATION:
o The direction of growth of the C stack is no longer determined at
runtime. Instead, it is assumed by default to grow downwards, as
is the case for virtually all current platforms. This can be
overridden when building pqR by including -DR_CStackDir=-1 in
CFLAGS. See the R-admin manual for more details.
NEW FEATURES:
o The for statement now has down and across forms, which
conveniently iterate over the rows (down) or columns (across) of
a matrix. See help("for") for details.
o C functions called from R (by .Call or .External) can now protect
objects from garbage collection using a new, less error-prone,
method, rather than the old (and still present) PROTECT and
UNPROTECT calls. See the section titled ``Handling the effects
of garbage collection'' (5.9.1) in the ``Writing R Exensions''
manual for details on the new facility, as well as improved
documentation on the old facilities.
o The serialize and saveRDS functions now take a nosharing
argument, which defaults to FALSE. When nosharing is TRUE,
constant objects (and perhaps in future other shared objects) are
serialized as if they were not shared. This is used in the
modified 'digest' package included with the release to ensure
that objects that are the same according to identical will have
identical serializations.
o The default for the last argument of substring is now
.Machine$integer.max. The previous default was 1000000 (and
still is in R-3.3.1), which made absolutely no sense, and is
likely responsible for bugs in user code that assumes that, for
example, substring(s,2) will always return a string like s but
without the first character, regardless of how many characters
are in s. This assumption will now actually be true.
o Since assignments like "1A"<-c(3,4) are allowed, for consistency,
pqR now also allows assignments like "1A"[2]<-10. However, it is
recommended that if a symbol that is not syntactically valid must
be used, it should be written with backquotes, as in `1A`[2]<-10.
This will work on the right-hand side too, and is also a bit
faster.
o .Call and .External now take a defensive measure against C code
that incorrectly assumes that the value stored in a variable will
not be shared with other variables. If .Call or .External is
passed a simple variable as an argument, and the value of that
variable is a scalar without attributes that is shared with
another variable (ie, NAMED is greater than 1), this value is
duplicated and reassigned before the C function is called. This
is a defense against incorrect usage, and should not be relied on
- instead, the incorrect usage should be fixed.
PERFORMANCE IMPROVEMENTS:
o Replacing part of a vector or list with [ ], [[ ]], and $ is now
often faster. The improvement can be by up to a factor two or
more when the index and replacement value are scalars.
o In some contexts, the unclass function now takes negligible time,
with no copying of the object that is unclassed. In particular
this is the case when unclass(x) is the object of a for
statement, the operand of an arithmetic operator, the argument of
a univariate mathematical function, or the argument of length.
For example, in
`+.myclass` <- function (e1, e2)
(unclass(e1) + unclass(e2)) %% 100
the two calls of unclass do not require duplicating e1 or e2.
o Arithmetic with a mixture of complex and real/integer operands is
now faster.
BUG FIXES:
o Fixed some problems with reporting of missing arguments to
functions, which were introduced in pqR-2016-06-24. For example,
f <- function(x) x; g <- function(y) f(y); g()
would not display an error message, when it should.
o Fixed a problem affecting mixed complex and real/integer
arithmetic when the result is directly assigned to one of the
operands, illustrated by
a <- 101:110; b <- (1:10)+0i; a <- a-b; a
o Fixed a bug involving invalid UTF-8 byte sequences, which was
introduced in R-2.15.1, and is present in later R Core releases
to at least R-3.3.1. The bug is illustrated by the following
code, which results in an infinite loop in the interpreter, when
run on a Linux system in a UTF-8 locale:
plot(0); text(1,0,"ab\xc3")
The code from R-2.15.1 causing the bug was incorporated into this
release of pqR, but the problem was fixed after the fBasics
package was seen to fail with a test release of pqR, so the bug
does not appear in any stable release of pqR.
o Fixed misinformation in help(length) about the length of
expressions (which is also present in R Core versions to at least
R-3.3.1).
o The usage in help("[[") now shows that the replacement form can
take more than one index (for arrays). (This is also missing in
R Core versions to at least R-3.3.1.)
NEW FEATURES FROM R CORE VERSIONS:
o From R-2.15.1: source() now uses withVisible() rather than
.Internal(eval.with.vis). This sometimes alters tracebacks
slightly.
o From R-2.15.1: splineDesign() and spline.des() in package splines
have a new option sparse which can be used for efficient
construction of a sparse B-spline design matrix (_via_ Matrix).
o From R-2.15.1: norm() now allows type = "2" (the spectral or
2-norm) as well, mainly for didactical completeness.
o From R-2.15.1 (actually implemented in pqR-2014-09-30, but not
noted in NEWS then): colorRamp() (and hence colorRampPalette())
now also works for the boundary case of just one color when the
ramp is flat.
o From R-2.15.1 (actually implemented in pqR-2014-09-30, but not
noted in NEWS then): For tiff(type = "windows"), the numbering of
per-page files except the last was off by one.
o From R-2.15.1 (actually implemented in pqR-2014-09-30, but not
noted in NEWS then): For R CMD check, a few people have reported
problems with junctions on Windows (although they were tested on
Windows 7, XP and Server 2008 machines and it is unknown under
what circumstances the problems occur). Setting the environment
variable R_WIN_NO_JUNCTIONS to a non-empty value (e.g. in
~/.R/check.Renviron) will force copies to be used instead.
o From R-2.15.1 and later R Core versions: More cases in which
merge() could create a data frame with duplicate column names now
give warnings. Cases where names specified in by match multiple
columns are errors. [ Plus other tweaks from later versions. ]
o From R-2.15.1: Added Polish translations by <c5><81>ukasz Daniel.
PERFORMANCE IMPROVEMENTS FROM R CORE VERSIONS:
o From R-2.15.1: In package parallel, makeForkCluster() and the
multicore-based functions use native byte-order for
serialization.
o From R-2.15.1: lm.fit(), lm.wfit(), glm.fit() and lsfit() do less
copying of objects, mainly by using .Call() rather than
.Fortran().
o From R-2.15.1: tabulate() makes use of .C(DUP = FALSE) and hence
does not copy bin. (Suggested by Tim Hesterberg.) It also
avoids making a copy of a factor argument bin.
o From R-2.15.1: Other functions (often or always) doing less
copying include cut(), dist(), the complex case of eigen(),
hclust(), image(), kmeans(), loess(), stl() and svd(LINPACK =
TRUE).
BUG FIXES CORRESPONDING TO THOSE IN R CORE VERSIONS:
o From R-2.15.1: Nonsense uses such as seq(1:50, by = 5) (from
package plotrix) and seq.int(1:50, by = 5) are now errors.
o From R-2.15.1: The residuals in the 5-number summary printed by
summary() on an "lm" object are now explicitly labelled as
weighted residuals when non-constant weights are present. (Wish
of PR#14840.)
o From R-2.15.1: The plot() method for class "stepfun" only used
the optional xval argument to compute xlim and not the points at
which to plot (as documented). (PR#14864)
o From R-2.15.1: hclust() is now fast again (as up to end of 2003),
with a different fix for the "median"/"centroid" problem.
(PR#4195).
o From R-2.15.1: In package parallel, clusterApply() and similar
failed to handle a (pretty pointless) length-1 argument.
(PR#14898)
o From R-2.15.1: For tiff(type = "windows"), the numbering of
per-page files except the last was off by one.
o From R-2.15.1: In package parallel, clusterApply() and similar
failed to handle a (pretty pointless) length-1 argument.
(PR#14898)
o From R-2.15.1: The plot() and Axis() methods for class "table"
now respect graphical parameters such as cex.axis. (Reported by
Martin Becker.)
o From R-2.15.1 (actually fixed in pqR-2014-09-30 but omitted from
NEWS): Under some circumstances package.skeleton() would give out
progress reports that could not be translated and so were
displayed by question marks. Now they are always in English.
(This was seen for CJK locales on Windows, but may have occurred
elsewhere.)
o From R-2.15.1: The replacement method for window() now works
correctly for multiple time series of class "mts". (PR#14925)
o From R-2.15.1: is.unsorted() gave incorrect results on non-atomic
objects such as data frames. (Reported by Matthew Dowle.)
o From R-2.15.1 (actually fixed in pqR-2014-09-30 but omitted from
NEWS): Using a string as a ?call? in an error condition with
options(showErrorCalls=TRUE) could cause a segfault. (PR#14931)
o From R-2.15.1: In legend(), setting some entries of lwd to NA was
inconsistent (depending on the graphics device) in whether it
would suppress those lines; now it consistently does so.
(PR#14926)
o From R-2.15.1: C entry points mkChar and mkCharCE now check that
the length of the string they are passed does not exceed 2^31-1
bytes: they used to overflow with unpredictable consequences.
o From R-2.15.1: by() failed for a zero-row data frame. (Reported
by Weiqiang Qian).
[ Note: When simplify=TRUE (the default), the results with
zero-row data frames, and more generally when there are empty
subsets, are not particularly sensible, but this has not been
changed in pqR due to compatibility concerns. ]
o From R-2.15.1: Yates correction in chisq.test() could be bigger
than the terms it corrected, previously leading to an infinite
test statistic in some corner cases which are now reported as
NaN.
o From R-2.15.1 (actually fixed in pqR-2014-09-30 but omitted from
NEWS): xgettext() and related functions sometimes returned items
that were not strings for translation. (PR#14935)
o From R-2.15.1: plot(<lm>, which=5) now correctly labels the
factor level combinations for the special case where all h[i,i]
are the same. (PR#14837)
CHANGES IN VERSION RELEASED 2016-06-24:
INTRODUCTION:
o This release extends the R language in ways that address a set of
related flaws in the design of R, and before it S.
These extensions make it easier to write reliable programs, by
making the easy way to do things also be the correct way, unlike
the previous situation with sequence generation using the colon
operator, and dimension dropping when subsetting arrays.
o Several other changes in features are also implemented in this
version, some of which are related to the major language
extensions.
o There are also a few bug fixes, and some improvements in testing,
but no major performance improvements (though some tweaks).
PACKAGE INSTALLATION:
o New packages (or other R code) that use the new ``along'' form of
the ``for'' statement, or which rely on the new facilities for
not dropping dimensions (see below), should not be byte compiled,
since these features are not supported in byte-compiled code. In
pqR, using byte compilation is not always advantageous in any
case.
o Installation and checking of existing packages may require
setting the environment variable R_PARSE_DOTDOT to FALSE, so that
names with interior sequences of dots will be accepted (see
below).
o The base package is no longer byte-compiled, even if pqR is
configured with --enable-byte-compiled-packages, since it now
uses new features not supported by the bytecode compiler.
MAJOR LANGUAGE EXTENSIONS AND OTHER CHANGES:
o There is a new .. operator for generating increasing integer
sequences, which is a less error-prone replacement for the :
operator (which remains for backwards compatibility). Since ..
generates only increasing sequences, it can generate an empty
sequence when the end value is less than the start value, thereby
avoiding some very common bugs that arise when : is used.
The .. operator also has lower precedence than arithmetic
operators (unlike :), which avoids another common set of bugs.
For example, the following code sets all interior elements of the
matrix M to zero, that is, all elements except those in the first
or last row or column:
for (i in 2..nrow(M)-1)
for (j in 2..ncol(M)-1)
M[i,j] <- 0
Without the new .. operator, it is awkward to write code for this
task that works correctly when M has two or fewer rows, or two or
fewer columns.
o In order that the .. operator can be conveniently used in
contexts such as i..j, consecutive dots are no longer allowed in
names (without using backticks), except at the beginning or end.
So i..j is not a valid name, but ..i.. is valid (though not
recommended). With this restriction on names, most uses of the
.. operator are unambiguous even if it is not surrounded by
spaces. The only exceptions are some uses in which .. is written
with a space after it but not before it, expressions such as
i..(a+b), which is a call of a function named i.., and
expressions such as i..-j, which returns the difference between
i.. and j. Most such uses will be stylistically bad, redundant
(note that the parentheses around a+b above are unnecessary), or
probably unlikely (as is the case for i..-j).
To accomodate old R code that has consecutive dots within names,
parsing of the .. operator can be disabled by setting the
parse_dotdot option to FALSE (with the options function). The
parse_dotdot option defaults to TRUE unless the environment
variable R_PARSE_DOTDOT is set to FALSE. When parse_dotdot is
FALSE, consecutive dots are allowed in names, and .. is not a
reserved word.
o Another source of bugs is the automatic dropping of dimensions of
size one when subsetting matrices (or higher-dimensional arrays)
using [], unless the drop=FALSE argument is specified. This
frequently results in code that mostly works, but not when, for
example, a data set has only one observation, or a model uses
only one explanatory variable.
To make handling this problem easier, if no drop argument is
specified, pqR now does not drop a dimension of size one if the
subscript for that dimension is a one-dimensional non-logical
array. For example, if A is a matrix, A[1..100,array(1)] will
produce a matrix, whereas A[1..100,1] will produce a vector.
To make this feature more useful, the new .. operator produces a
one-dimensional array, not a bare vector. So A[1..n,1..m] will
always produce a matrix result, even when n or m are one. (It
will also correctly produce an array with zero rows or zero
columns when n or m are zero.)
This change also applies to subsetting of data frames. For
example, df[1..10,1..n] will return a data frame (not a vector)
even when n is one.
o Problems with dimensions of size one being dropped also arise
when an entire row, or an entire column, is selected with an
empty (missing) subscript, and there happens to be only one row,
or only one column. For example, if A is a matrix with one
column, A[1:10,] will be a vector, not a matrix.
To address this problem, pqR now allows a missing argument to be
specified by _, rather than by nothing at all, and the []
operator (for matrices, arrays, and data frames) will not drop a
dimension if its subscript is _. So A[1:10,_] will be a matrix
even when A has only one column.
R functions that check for a missing argument with the missing
function will see both an empty argument and _ as missing, but
can distinguish them using the missing_from_underline function.
o A common use of for statements is to iterate over indexes of a
vector, or row and column indexes of a matrix. A new type of for
statement with ``along'' rather than ``in'' now makes this more
convenient.
For vectors, the form
for (i along vec) ...
is equivalent to
for (i in seq_along(vec)) ...
For matrices, the form
for (i, j along M) ...
is equivalent to
for (j in 1..ncol(M))
for (i in 1..nrow(M))
...
However, if M is of a class with its own dim method, this method
is not used (effectively, ncol(unclass(M)) and nrow(unclass(m))
are used). This may well change in future, and similarly a
length method may in future be used when ``along'' is used with a
vector.
o Because of the new restriction on names, the make.names function
will now (by default) convert a sequence of consecutive dots in
the name it would otherwise have made to a single dot. (See
help(make.names) for further details).
o For the same reason, make.unique has been changed so that the
separator string (which defaults to a dot) will not be appended
to a name if the name already ends in that string.
BUG FIXES:
o Fixed a bug (or mis-feature) in subsetting with a single empty
subscript, as in A[]. This now works the same as if the empty
subscript had been the sequence of all indexes (ie, like
A[1..length(A)]), which removes all attributes except names.
R Core versions to at least R-3.3.1 instead return A unchanged,
preserving all attributes, though attributes are not retained
with other uses of the [] operator. This is contrary to the
description in help("["), and also does not coincde with the
(different) description in the R language definition.
Returning A unchanged is not only inconsistent, but also useless,
since there is then no reason to ever write A[]. However,
internally, R Core implementions duplicate A, which may be of
significance when A[] is passed as an argument of .C, .Fortran,
.Call, or .External, but only if the programmer is not abiding by
the rules. However, in pqR, the data part of a vector or matrix
is still copied when A[] is evaluated, so such rule-breaking
should still largely be accommodated. A further temporary kludge
is implemented to make x[,drop=FALSE] simply return a duplicate
of x, since this (pointless) operation is done by some packages.
o Fixed bugs in the conversion of strings to numbers, so that the
behaviour now matches help(NumericConstants), which states that
numeric constants are parsed very similarly to C99. This was not
true before (or in R-2.15.0) - some erroneous syntax was accepted
without error, and some correct syntax was rejected, or gave the
wrong value.
In particular, fractional parts are now accepted for hexadecimal
constants. Later R Core versions made some fixes, but up to at
least R-3.3.1 there are still problems. For example, in R-3.3.1,
parse(text="0x1.8")[[1]] gives an error, and as.numeric("0x1.8")
produces 24 (as does scan when given this input). In this
version of pqR, these return the correct value of 1.5.
o Fixed a problem with identifying the version of the makeinfo
program that is installed that arises with recent versions of
makeinfo.
o Put in a check for non-existent primitives when unserializing R
objects, as was done in R-3.0.1.
o Fixed a bug (also in R-2.15.0, but fixed in later R Core
versions) illustrated by the following code:
a <- array(c(3,4),dimnames=list(xyz=c("fred","bert")))
print(a[1:2])
print(a[]) # should print same thing, but didn't
o Fixed a bug illustrated by the following code:
f <- function (x) { try(x); missing(x) }
g <- function (y) f(y)
h <- function (z) g(z)
f(pi[1,1]) # FALSE
g(pi[1,1]) # FALSE
h(pi[1,1]) # Should also be FALSE, but isn't!
This bug is in R Core versions to at least R-3.3.1.
o Fixed a bug in which an internal error message is displayed as
shown below:
> f <- function (...) ..1; f()
Error in f() : 'nthcdr' needs a list to CDR down
A sensible error message is now produced. This bug is also in R
Core versions to at least R-3.3.1.
o Fixed a bug in S4 method dispatch that caused failure of the
no-segfault test done by make check-all on Windows 10 (pqR issue
#29 + related fix). (Also in R-2.15.0, and partially fixed in
R-3.3.0.)
o Fixed a bug illustrated by
atan; show <- function (x) cat("HI\n"); atan
Now, pqR no longer prints HI! for the second display of atan.
o Fixed a pqR bug in which the result of getParseData omitted the
letter at the end of 1i or 1L.
o Fixed a pqR bug in which enabling trace output from the helpers
module and then typing control/C while trace output is being
printed could lead to pqR hanging.
CHANGES IN VERSION RELEASED 2015-09-14:
INTRODUCTION:
o With this release, pqR now works on Microsoft Windows systems.
See below for details.
o The facilities for embedding R in other applications have also
been tested in this release, and some problems with how this is
done in R Core versions have been fixed.
o The parser and deparser, and the method for performing the basic
Read-Eval-Print Loop, have been substantially rewritten. This
has few user-visible effects at present (apart from bug fixes and
performance improvements), but sets the stage for future
improvements in pqR.
o The facility for recording detailed parsing data introduced n
R-3.0.0 has now been implemented in pqR as part of the parser
rewrite.
o There are also a few other improvements and bug fixes.
INSTALLATION ON MICROSOFT WINDOWS:
o Building pqR on Microsoft Windows systems, using the Rtools
facilities, has now been tested, and some problems found in this
environment have been fixed. Binary distributions are not yet
provided, however.
o Detailed and explicit instructions for building pqR from source
on Windows systems are now provided, in the src/gnuwin32/INSTALL
file of the pqR source directory. These instructions mostly
correspond to information in The R Installation and
Administration manual, but in more accessible form.
o See <URL: pqR-project.org> for more information on Windows
systems on which pqR has been tested, and on any problems and
workarounds that may have been discovered.
o The Writing R Extensions manual now warns that on Windows, with
the Rtools toolchain, a thread started by OpenMP may have its
floating point unit set so that long double arithmetic is the
same as double arithmetic Use __asm__("fninit") in C to reset the
FPU so that long double arithmetic will work.
o The default is now to install packages from source, since there
is no binary repository for pqR.
EMBEDDED R FACILITIES AND EXAMPLES:
o The R_ReplDLLinit and R_ReplDLLdo1 functions in src/main/main.c
have been fixed to handle errors correctly, and to avoid code
duplication with R_ReplIteration.
o Another test of embedded R has been added to tests/Embedding,
which is the same as an example in the R Extensions manual, which
has been improved.
o Another example in the R Extensions manual has been changed to
mimic src/gnuwin32/embeddedR.c.
o The example in src/gnuwin32/front-ends/rtest.c has also been
updated.
DOCUMENTATION UPDATES:
o The R Language Definition and the help files on assignment
operators (eg, help("=")) contained incorrect and incomplete
information on the precedence of operators, especially the
assignment operators. This and other incorrect information has
been corrected.
o The examples in help(parse) and help(getParseData have been
improved.
INTERNAL CODE REWRITES:
o The parser has been rewritten to use top-down recursive descent,
rather than a bottom-up parser produced by Bison as was used
previously. This substantially simplifies the parser, and allows
several kludges in the previous scheme to be eliminated. Also,
the rewritten parser can now record detailed parse information
(see below).
The new parser for pqR is usually about a factor of 1.5 faster
than the parser in R-3.2.2, but it is sometimes enormously
faster, since the parser in R-3.2.2 will in some contexts take
time growing as the square of the length of the source file.
o Much of the deparser has been rewritten. It no longer looks at
the definitions of operators, which are irrelevant, since the
parser does not look at them.
o The methods by which the Read-Eval-Print Loop (REPL) is done (in
various contexts) have been rationalized, in coordination with
the new parsing scheme.
NEW FEATURES:
o In pqR-2015-07-11, the parser was changed to not include
parentheses in R language objects if they were necessary in order
for the expression to be parsed correctly. Omitting such
parentheses improves performance. In this version, such
parentheses are removed only if the keep.parens option is FALSE
(the default). Also, parentheses are never removed from
expressions that are on the right side of a formula, since some
packages asssign significance to such parentheses beyond their
grouping function.
o The right assignment operators, -> and ->>, are now real
operators. Previously (and in current R Core versions),
expressions involving these operators were converted to the
corresponding left assignment expressions. This has the
potential to cause pointless confusion.
o The ** operator, which has always been accepted as a synonym for
the ^ operator, is now recorded as itself, rather than being
converted to ^ by the parser. This avoids unnecessary anomalies
such as the following confusing error report:
> a - **b
Error: unexpected '^' in "a - **"
The ** operator is defined to be the same primitive as ^, which
is associated with the name ^, and hence dispatches on methods
for ^ even if called via **.
NEW FEATURES FROM LATER R CORE VERSIONS:
o From R-3.0.0: For compatibility with packages written to be able
to handle the long vectors introduced in R-3.0.0, definitions for
R_xlen_t, R_XLEN_T_MAX, XLENGTH, XTRUELENGTH, SHORT_VEC_LENGTH,
SET_SHORT_VEC_TRUELENGTH are now provided, all the same as the
corresponding regular versions (as is also the case for R-3.0.0+
on 32-bit platforms). The IS_LONG_VEC macro is also defined (as
always false). Note, however, that packages that declare a
dependency on R >= 3.0.0 will not install even if they would in
fact work with pqR because of these compatibility definitions.
o From R-3.0.0: The srcfile argument to parse() may now be a
character string, to be used in error messages.
o The facilities for recording detailed parsing information from
R-3.0.0 are now implemented in pqR, as part of the rewrite of the
parser, along with the extension to provide partial parse
information when a syntax error occurs that was introduced in
R-3.0.2. See help on parse and getParseData for details.
o From R-2.15.2: On Windows, the C stack size has been increased to
64MB (it has been 10MB since the days of 32MB RAM systems).
PERFORMANCE IMPROVEMENTS:
o Character-at-a time input has been sped up by reducing procedure
call overhead. This significantly speeds up readLines and scan.
o The new parser is faster than the old parser, both because of the
parser rewrite (see above) and because of the faster character
input.
BUG FIXES MATCHING THOSE IN LATER R CORE VERSIONS:
o From R-2.15.1: Names containing characters which need to be
escaped were not deparsed properly (PR#14846). Fixed in pqR
partly based on R Core fix.
o From R-2.15.2: When given a 0-byte file and asked to keep source
references, parse() read input from stdin() instead.
o From R-2.15.3: Expressions involving user defined operators were
not always deparsed faithfully (PR#15179). Fixed in pqR as part
of the rewrite of the parser and deparser.
o From R-3.0.2: source() did not display filenames when reporting
syntax errors.
o From R-3.1.3: The parser now gives an error if a null character
is included in a string using Unicode escapes. (PR#16046)
o From R-3.0.2: Deparsing of infix operators with named arguments
is improved (PR#15350). [ In fact, the change, both in pqR and in
R Core versions, is only with respect to operators in percent
signs, such as %fred%, with these now being deparsed as function
calls if either argument is named. ]
o From R-3.2.2: Rscript and command line R silently ignored
incomplete statements at the end of a script; now they are
reported as parse errors (PR#16350). Fixed in pqR as part of the
rewrite of the parser and deparser.
o From R-3.2.1: The parser could overflow internally when given
numbers in scientific format with extremely large exponents.
(PR#16358). Fixed in pqR partly as in R Core fix. Was actually
a problem with any numerical input, not just with the parser.
o From R-3.1.3: Extremely large exponents on zero expressed in
scientific notation (e.g. 0.0e50000) could give NaN (PR#15976).
Fixed as in R Core fix.
o From R-2.15.3: On Windows, work around an event-timing problem
when the RGui console was closed from the 'X' control and the
closure cancelled. (This would on some 64-bit systems crash R,
typically those with a slow GPU relative to the CPU.)
BUG FIXES:
o Fixed a bug in which a "cons memory exhausted" error could be
raised even though a full garbage collection that might recover
more memory had not been attempted. (This bug appears to be
present in R Core versions as well.)
o The new parser fixes bugs arising from the old parser's kludge to
handle semicolons, illustrated by the incorrect output seen
below:
> p<-parse()
?"abc;xyz"
Error in parse() : <stdin>:1:1: unexpected INCOMPLETE_STRING
1: "abc;
^
> p<-parse()
?8 #abc;xyz
Error in parse() : <stdin>:1:7: unexpected end of input
1: 8 #abc;
^
o Fixed deparsing of complex numbers, which were always deparsed as
the sum of a real and an imaginary part, even though the parser
can only produce complex numbers that are pure imaginary. For
example, the following output was produced before:
> deparse(quote(3*5i))
[1] "3 * (0+5i)"
This is now deparsed to "3 * 5i". This bug exists in all R Core
versions through at least R-3.2.2.
o Fixed a number of bugs in the deparser that are illustrated by
the following, which produce incorrect output as noted, in R Core
versions through at least R-3.2.2:
deparse(parse(text="`+`(a,b)[1]")[[1]])# Omits necessary parens
deparse(quote(`[<-`(x,1)),control="S_compatible") # unmatched " and '
deparse(parse(text="a = b <- c")[[1]]) # Puts in unnecessary parens
deparse(parse(text="a+!b")[[1]]) # Puts in unnecessary parens
deparse(parse(text="?lm")[[1]]) # Doesn't know about ? operator
deparse(parse(text="a:=b")[[1]]) # Doesn't know about := operator
deparse(parse(text="a$'x'")[[1]]) # Conflates name and character
deparse(parse(text="`*`(2)")[[1]]) # Result is syntactically invalid
deparse(parse(text="`$`(a,b+2)")[[1]]) # Result is syntactically invalid
e<-quote(if(x) X else Y); e[[3]]<-quote(if(T)3); deparse(e)# all here
e <- quote(f(x)); e[[2]] <- quote((a=1))[[2]]; deparse(e) # and below
e <- quote(f(Q=x)); e[[2]] <- quote((a=1))[[2]]; deparse(e)# need parens
e <- quote(while(x) 1); e[[2]] <- quote((a=1))[[2]]; deparse(e)
e <- quote(if(x) 1 else 2); e[[2]] <- quote((a=1))[[2]]; deparse(e)
e <- quote(for(x in y) 1); e[[3]] <- quote((a=1))[[2]]; deparse(e)
In addition, the bug illustrated below was fixed, which was fixed
(differently) in R-3.0.0:
a<-quote(f(1,2)); a[[1]]<-function(x,y)x+y; deparse(a) # Omits parens
o Fixed the following bug (also in R Core versions to at least
R-3.2.2):
> parse()
?'\12a\x.'
Error: '\x' used without hex digits in character string starting "'\1a\x"
Note that the "2" has disappeared from the error message. This
bug also affected the results of getParseData.
o Fixed a memory leak that can be seen by running the code below:
> long <- paste0 (c('"', rep("1234567890",820), '\x."'), collapse="")
> for (i in 1:1000000) try (e <- parse(text=long), silent=TRUE)
The leak will not occur if 820 is changed to 810 in the above.
This bug also exists in R Core versions to at least R-3.2.2.
o Entering a string constant containing Unicode escapes that was
9999 or 10000 characters long would produce an error message
saying "String is too long (max 10000 chars)". This has been
fixed so that the maximum now really is 10000 characters. (Also
present in R Core versions, to at least R-3.2.2.)
o Fixed a bug that caused the error caret in syntax error reports
to be misplaced when more than one line of context was shown.
This was supposedly fixed in R-3.0.2, but incorrectly, resulting
in the error caret being misplaced when only one line of context
is shown (in R Core versions to at least R-3.2.2).
o On Windows, running R.exe from a command prompt window would
result in Ctrl-C misbehaving. This was PR#14948 at R Core, which
was supposedly fixed in R-2.15.2, but the fix only works if a 32
or 64 bit version of R.exe is selected manually, not if the
version of R.exe that automatically runs the R.exe for a selected
architecture is used (which is the intended normal usage).
CHANGES IN VERSION RELEASED 2015-07-11:
INTRODUCTION:
o This version is a minor modification of the version of pqR
released on 2015-06-24, which does not have a separate NEWS
section, incorporating also the changes in the version released
2015-07-08. These modifications fix some installation and
testing issues that caused problems on some platforms. There are
also a few documentation and bug fixes, a few more tests, and
some expansion in the use of static boxes (see below). Version
2015-06-24 of pqR improved reliability and portability, and also
contained some performance improvements, including some that
substantially speed up interpretive execution of programs that do
many scalar operations. Details are below.
INSTALLATION:
o The method used to quickly test for NaN/NA has changed to one
that should work universally for all current processors (any
using IEEE floating point, as already assumed in R, with
consistent endianness, as is apparently the case for all current
general-purpose processors, and was partially assumed before).
There is therefore no longer any reason to define the symbol
ENABLE_ISNAN_TRICK when compiling pqR (it will be ignored if
defined).
o The module used to support parallel computation in helper threads
has been updated to avoid a syntactic construction that
technically violates the OpenMP 3.1 specification. This
construction had been accepted without error by gcc 4.8 and
earlier, but is not accepted by some recent compilers.
o The tests in the version supplied of the recommended Matrix
package have been changed to not assume things that may not be
true regarding the speed and long double precision of the machine
being used. (These tests produced spurious errors on some
platforms.)
DOCUMENTATION UPDATE: