Displaying 20 results from an estimated 20000 matches similar to: "calls with comment attribute"
2019 Nov 13
2
calls with comment attribute
I suspect that the parser used it to store comments, including the initial
"#", before R started using the srcref attribute. (S also stored comments
in the parse tree.)
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Tue, Nov 12, 2019 at 4:16 PM Duncan Murdoch <murdoch.duncan at gmail.com>
wrote:
> On 12/11/2019 5:01 p.m., William Dunlap via R-devel wrote:
> > In
2020 May 15
3
edit() doubles backslashes when keep.source=TRUE
Is it just my installation or does edit() (or fix(), etc.) in R-4.0.0
double all the backslashes when options(keep.source=TRUE)? E.g.,
> options(keep.source=TRUE)
> f <- function(x) { cat("\t", x, "\n", sep="") }
> edit(f) # exit the editor without making any changes
The editor (vi or notepad) shows doubled backslashes
function(x) {
2009 May 21
3
file descriptor leak in getSrcLines in R 2.10.0 svn 48590
I noticed the following file descriptor leak when I couldn't remove
a package unless I shut down the R session that had loaded and
used it. The function that triggered the problem printed the output
of a call to parse(). Each time one prints a srcref a connection is
opened and not closed. It looks like it happens in
as.character.srcref's
call to getSrcLines, which has some logic I
2011 Jan 07
1
formula(model.frame(y~.^2, data=d)) does not return formula from terms attribute of the model.frame
In R 2.12.0 I get
> d <- data.frame(x=1:10, y=log(1:10), f3=LETTERS[rep(1:3,c(3,3,4))])
> m <- model.frame(y~.^2, data=d)
> formula(m)
y ~ x + f3
In S+ formula(m) gives formula given to model.frame(),
but in R you have to do the following get that formula:
> formula(attr(m, "terms"))
y ~ (x + f3)^2
Would it break anything to add to the top of
2015 Oct 13
1
identical(..., ignore.environment=TRUE)
MM> but I don't think we'd want to
MM> change all.equal.language() at this point in time
Although it would be nice if all.equal looked at least at attributes of
formulas
so we did not get results like
> form <- y ~ x1 %in% x2
> all.equal(form, terms(form))
[1] TRUE
> all.equal(terms(y~x1+x2+Error(x3/x2), specials="Error"),
terms(y~x1+x2+Error(x3/x2)))
2016 Oct 04
2
error handling in strcapture
I noticed a problem in the strcapture from R-devel (2016-09-27 r71386),
when the text contains a missing value and perl=TRUE.
{
# NA in text input should map to row of NA's in output, without
warning
r9p <- strcapture(perl = TRUE, "(.).* ([[:digit:]]+)", c("One 1", NA,
"Fifty 50"), data.frame(Initial=factor(), Number=numeric()))
e9p <-
2016 Oct 04
1
error handling in strcapture
It is also not catching the cases where the number of capture expressions
does not match the number of entries in proto. I think all of the
following should give an error about the mismatch.
> strcapture("(.)(.)", c("ab", "cde", "fgh", "ij", "lm"),
proto=list(A="",B="",C=""))
A B C
1 a b cd
2 d
2016 Apr 12
0
[FORGED] Re: identical() versus sapply()
Use all.equal instead of identical if you want to gloss over
integer/numeric class differences and minor floating point differences (and
a host of others).
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Mon, Apr 11, 2016 at 5:25 PM, Paulson, Ariel <apa at stowers.org> wrote:
> Hi Jeff,
>
>
> We are splitting hairs because R is splitting hairs, and causing us
> problems.
2017 Oct 09
1
Regular expression help
"(^| +)([^/ ]*/?){0,2}", with the first "*" replaced by "+" would be a bit
better.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Mon, Oct 9, 2017 at 8:50 AM, William Dunlap <wdunlap at tibco.com> wrote:
> > x <- "f 147/1315/587 2820/1320/587 3624/1321/587 1852/1322/587"
> > gsub("(^| *)([^/ ]*/?){0,2}", "\\1", x)
2017 Jul 06
2
attributes on symbols
The multcomp package has code in multcomp:::expression2coef that attaches
the 'coef' attribute to symbols. Since there is only one symbol object in
a session with a given name, this means that this attaching has a global
effect. Should this be quietly allowed or should there be a warning or an
error?
E.g.,
str(quote(Education))
# symbol Education
lmod <- stats::lm(Fertility ~ .,
2015 Jul 15
2
bquote/evalq behavior changed in R-3.2.1
David,
If you are referring to the solution that would be:
rapply(list(test), eval, envir = fenv)
I thought I explained in the question that the above code does not work. It
does not throw an error, but the behavior is no different (at least in the
output or result). Using the above code still results in the x object not
being stored in fenv on 3.1.2.
Dayne
On Wed, Jul 15, 2015 at 4:40 PM,
2017 Dec 29
1
winbuilder warning message wrt function pointers
And remove the cast on the return value of R_GETCCallable. And check
that your function is found before using it.
#include <R.h>
#include <Rinternals.h>
#include <R_ext/Rdynload.h>
void bdsmatrix_prod4(int nrow, int nblock, int *bsize,
double *bmat, double *rmat,
int nfrail, double *y) {
DL_FUNC fun = NULL;
if (fun==NULL)
2019 Aug 30
1
New lazyload rdx key type: list(eagerKey=, lazyKeys=)
Prior to R-3.6.0 the keys in the lazyload key files, e.g.
pkg/data/Rdata.rdx or pkg/R/pkg.rdx, seemed to all be 2-long integer
vectors. Now they can be lists. The ones I have seen have two components,
"eagerKey" is a 2-long integer vector and "lazyKeys" is a named list of
2-long integer vectors.
> rdx <- readRDS(system.file(package="survival",
2010 Mar 12
1
problem with parse(text=quote(name))
Calling parse(text=quote(name)) or text=as.name("name")
makes parse() prompt for input from the command line
and then it returns a parse of the initial characters
of 'name' (depending on how many characters were typed
at the prompt). E.g.,
> parse(text=quote(myName))
?1/3
expression(myN)
attr(,"srcfile")
<text>
>
2016 Sep 21
2
error handling in strcapture
If there are any matches then strcapture can see if the pattern has the
same number of capture expressions as the prototype has columns and give an
error if not. That seems appropriate.
If there are no matches, then there is no easy way to see if the prototype
is compatible with the pattern, so should strcapture just assume the best
and fill in the prototype with NA's?
Should there be
2019 Sep 08
1
Error: package or namespace load failed for ‘utils
Also, check the settings of R_HOME and/or R_LIBS.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Sun, Sep 8, 2019 at 9:58 AM William Dunlap <wdunlap at tibco.com> wrote:
> Look at section 6.1 of the R Installation and Admin manual.
>
> 6.1 Default packages
>
> The set of packages loaded on startup is by default
>
> > getOption("defaultPackages")
> [1]
2016 Apr 21
1
"cophenetic" function for objects of class "dendrogram"
Note that cophenetic.default (which works on the output of hclust(dist(X)))
uses the
row names of X as labels. as.dendrogram.hclust does not retain those row
names
so cophenetic.dendrogram cannot use them (so it orders them based on the
topology of the dendrogram).
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Thu, Apr 21, 2016 at 7:59 AM, William Dunlap <wdunlap at tibco.com> wrote:
2015 Jul 15
2
bquote/evalq behavior changed in R-3.2.1
On Jul 15, 2015, at 12:51 PM, William Dunlap wrote:
> I think rapply() was changed to act like lapply() in this respect.
>
When I looked at the source of the difference, it was that typeof() returned 'language' in 3.2.1, while it returned 'list' in the earlier version of R. The first check in rapply's code in both version was:
if (typeof(object) != "list")
2016 Sep 09
3
Different results for tan(pi/2) and tanpi(1/2)
The same argument would hold for tan(pi/2).
I don't say the result 'NaN' is wrong,
but I thought,
tan(pi*x) and tanpi(x) should give the same result.
Hans Werner
On Fri, Sep 9, 2016 at 8:44 PM, William Dunlap <wdunlap at tibco.com> wrote:
> It should be the case that tan(pi*x) != tanpi(x) in many cases - that is why
> it was added. The limits from below and below of the
2016 Jul 27
2
Model object, when generated in a function, saves entire environment when saved
Another solution is to only save the parts of the model object that
interest you. As long as they don't include the formula (which is
what drags along the environment it was created in), you will
save space. E.g.,
tfun2 <- function(subset) {
junk <- 1:1e6
list(subset=subset, lm(Sepal.Length ~ Sepal.Width, data=iris,
subset=subset)$coef)
}
saveSize(tfun2(1:4))
#[1] 152
Bill