Passing in a function passes not only an argument list but also an
environment from which to get free variables. Since your function doesn't
pay attention to the environment you get things like the following.
> wsapply(list(1,2:3), paste(., ":", deparse(s)))
[[1]]
[1] "1 : paste(., \":\", deparse
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) sh
I agree: paste(collapse="something", ...) should always return a single
character string, regardless of the value of recycle0. This would be
similar to when there are no non-NULL arguments to paste; collapse="."
gives a single empty string and collapse=NULL gives a zero long character
vector.
> pa
do.call(order, df). -> do.call(order, unname(df)).
While you are looking at order(), it would be nice if ';decreasing' could
be a vector the the length of list(...) so you could ask to sort some
columns in increasing order and some decreasing. I thought I put this on
bugzilla eons ago, but perh
to be more logical / coherent / sensical ..
>
> Is the above all correct in your view?
>
> Assuming yes, I read basically two proposals, both agreeing
> that recycle0 = TRUE should only ever apply to the action of 'sep'
> but not the action of 'collapse'.
&
t;, "b"), NULL, c("c", "d"), sep = " ", collapse = ",",
> > recycle0=TRUE)
> >
> > Currently that returns character(0), becuase the logic is
> > essenttially (in pseudo-code)
> >
> > collapse(paste(c(&
Am am missing something or does the new ...names() in R-devel not work
right?
> a <- function(x, ...) ...names()
> a(a=stop("a"), b=stop("b"))
[1] "a" ""
> a(stop("x"), stop("unnamed"), c=stop("c"), d=stop("d"))
[1] NA "" ""
> version
_
platform x86_64-pc-linux-gnu
arch
Is there a reason that array() silently ignores dimnames that are not
a list but matrix() gives an error?
> str(matrix(11:14, 2, 2, dimnames=c("Rows","Cols")))
Error in matrix(11:14, 2, 2, dimnames = c("Rows", "Cols")) :
'dimnames' must be a list
> str(array(11:14, dim=c(2, 2), dimnames=
as.data.frame methods behave inconsistently when they are given a row.name
argument of the wrong length. The matrix method silently ignores row.names
if it has the wrong length and the numeric, integer, and character methods
do not bother to check and thus make an illegal data.frame.
> as.data.fr
What is the point of the 'endrule' attribute of smooth()'s return value?
For the simpler smooths (not involving 'S'?) it is value of the endrule
argument, for more complicated smooths it is the endrule not asked for (the
choices are 'Tukey' and 'copy'). For kind="S", it is not in the return
value
Is it intended that in yesterday's version of R-devel the default value of
keepNA is different in nchar (NA) and nzchar (FALSE)?
> args(nchar)
function (x, type = "chars", allowNA = FALSE, keepNA = NA)
NULL
> args(nzchar)
function (x, keepNA = FALSE)
NULL
Is it intended that for keepN
>If I recall correctly, some eigen vectors had their
>direction flipped (negative values became positive and vice versa).
>Did you notice anything of this kind when running 'make check' and
>'make check recommended' ? It is important to us that numeric results
>are reproducible between versions of
> but this strategy quickly inflates the number of packages on CRAN.
CRAN contains 8210 packages today, so I would not worry about
adding an extra one.
Also, I think several small packages are preferable to one large one
because attaching a big one just to get the one or two functions you
want is
Shouldn't the following 4 ways to alter an object in a locked environment
either all work or all fail? (All working would be nice, I think.)
E <- new.env()
assign("var", c(1,2,3,4), envir=E)
lockEnvironment(E, bindings=FALSE)
E$var[1] <- 101 ; E$var
#[1] 101 2 3
local(var[2]
I think the results differ only in the order of the labels. The following
function
puts the labels in a standard order and then the results are the same:
canonicalize.dist <- function (distObject)
{
o <- order(labels(distObject))
as.matrix(distObject)[o, o, drop = FALSE]
}
ide
wdunlap tibco.com
On Thu, Apr 21, 2016 at 7:59 AM, William Dunlap wrote:
> I think the results differ only in the order of the labels. The following
> function
> puts the labels in a standard order and then the results are the same:
>
> canonicalize.dist <- function (distObjec
The R language itself has features that limit how much
mulitthreading/parallel processing can be done. There are functions with
side effects, such as library(), plot(), runif(), <-, and <<- and there are
no mechanisms to isolate them.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Thu, May 12,
In knitr-1.13 the DESCRIPTION file's Depends line uses a ">" instead of the
usual ">=".
Depends: R (> 3.0.2)
I don't see the strict greater than in Writing R Extensions. Does it
really mean that 3.0.2 is not suitable and that whatever version comes
after it is?
Bill Dunlap
TIBCO Software
wdunla
Why should Rf_mkString(NULL) produce NA_STRING instead of ""
(R_BlankString)? I prefer that passing in a nil pointer would cause
an error instead, as the nil may arise by accident, perhaps a pointer
to freed memory, and I would like to be notified that my code is bad instead
of getting a random NA
While constructing some tests of symbolic link code in R, I got
an odd warning when trying the remove a symbolic link:
file.create(tfile <- tempfile())
#[1] TRUE
file.symlink(tfile, tlink <- tempfile())
#[1] TRUE
unlink(tlink)
#Warning message:
#In unlink(tlink) :
# cannot delete reparse point
'C
In R code tryCatch can detect the difference. Hit control-C (on Unixen) or
Escape
(on Windows) to interrupt the long-running for loop and see that the
interrupt clause
gets called:
> z <- tryCatch(for(i in seq_len(1e8))log(exp(i/10)), error=function(e)e,
interrupt=function(e)e)
^C> dput(z)
struct
One way around this problem is to make a new environment whose
parent environment is .GlobalEnv and which contains only what the
the call to lm() requires and to compute lm() in that environment. E.g.,
tfun1 <- function (subset)
{
junk <- 1:1e+06
env <- new.env(parent = globalenv())
=subset, lm(Sepal.Length ~ Sepal.Width, data=iris,
subset=subset)$coef)
}
saveSize(tfun2(1:4))
#[1] 152
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Wed, Jul 27, 2016 at 11:19 AM, William Dunlap wrote:
> One way around this problem is to make a new environment whose
> parent environment is .Gl
What should findInterval(x,vec,all.inside=TRUE) return when length(vec)<=1,
so there are no inside intervals?
R-3.3.0 gives a decreasing map of x->output when length(vec)==1 and -1's
when length(vec)==0. Would '0' in all those cases be better?
> findInterval(x=c(10, 11, 12), vec=11, all.inside=T
Try comparing the streams for when the 625-integer versions of the seeds
are identical. (R's seed is 626 integers: omit the first value, which
indicates which random number generator the seed is for.). I find the the
MKL Mersenne Twister results match R's (with occassional differences in the
last
Re withAutoprint(), Splus's source() function could take a expression
(literal or not) in place of a file name or text so it could support
withAutoprint-like functionality in its GUI. E.g.,
> source(auto.print=TRUE, exprs.literal= { x <- 3:7 ; sum(x) ; y <- log(x)
; x - 100}, prompt="--> ")
--> x
Shouldn't binary operators (arithmetic and logical) should throw an error
when one operand is NULL (or other type that doesn't make sense)? This is
a different case than a zero-length operand of a legitimate type. E.g.,
any(x < 0)
should return FALSE if x is number-like and length(x)==0 but
E, as is all(numeric()>0), by de
Morgan's rule, but that is not really relevant here.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Thu, Sep 8, 2016 at 10:22 AM, Gabriel Becker
wrote:
>
>
> On Thu, Sep 8, 2016 at 10:05 AM, William Dunlap wrote:
>
>> Shouldn't
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 real function
tan(pi*x) as x approaches 1/2 are different, +Inf and -Inf, so the limit is
not well defined. Hence the computer function tanpi(1/2) ought to return
Not
gt; 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 wrote:
> > It should be the case that tan(pi*x) != tanpi(x) in many cases - that is
> why
> > it was added. The limits fro
; > 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, Willi
While you are editing that, you might change its name from 'stderr'
to standardError (or standard_error, etc.) so as not to conflict with
base::stderr().
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Tue, Sep 13, 2016 at 8:55 AM, Martin Maechler wrote:
> > Suharto Anggono Suharto Anggono
The new strcapture function in R-devel is handy, capturing
the matches to the parenthesized subpatterns in a regular
expression in the columns of a data.frame, whose column
names and classes are given by the 'proto' argument. E.g.,
> p1 <- data.frame(Name="", Number=0)
> str(strcapture("([[:alpha
Michael, thanks for looking at my first issue with utils::strcapture.
Another issue is how it deals with lines that don't match the pattern.
Currently it gives an error
> strcapture("(.+) (.+)", c("One 1", "noSpaceInLine", "Three 3"),
proto=list(Name="", Number=0))
Error in strcapture("(.+) (.+)"
M, Michael Lawrence wrote:
> Hi Bill,
>
> Thanks, another good suggestion. strcapture() now returns NAs for
> non-matches. It's nice to have someone kicking the tires on that
> function.
>
> Michael
>
> On Wed, Sep 21, 2016 at 12:11 PM, William Dunlap via R-devel
&g
In Splus c() and unlist() called the same C code, but with a different
'sys_index' code (the last argument to .Internal) and c() did not consider
an argument named 'use.names' special.
> c
function(..., recursive = F)
.Internal(c(..., recursive = recursive), "S_unlist", TRUE, 1)
> unlist
function
In addition, there is a formula method for data.frame that
assumes the first column is the dependent variable.
> z <- data.frame(X1=1:6,X2=letters[1:3],Y=log(1:6))
> formula(z)
X1 ~ X2 + Y
> colnames(model.matrix(formula(z), z))
[1] "(Intercept)" "X2b" "X2c" "Y"
Spencer's requ
s that it yields NAs when the pattern does not match
> (like strptime) and for empty captures in a matching pattern it yields
> the empty string, which is consistent with regmatches().
>
> Michael
>
> On Wed, Sep 21, 2016 at 2:21 PM, William Dunlap wrote:
> > If there ar
col = ntokens, byrow = TRUE) :
data length [20] is not a sub-multiple or multiple of the number of rows
[7]
> strcapture("(.)(.)(.)", c("abc", "def"), proto=list(A=""))
A
1 a
2 c
3 d
4 f
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Tue, Oct 4, 20
Here is a simplified version of your problem
> { sqrt }(c(2,4,8))
[1] 1.414214 2.00 2.828427
Do you want that to act differently?
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Oct 21, 2016 at 6:10 AM, Wilm Schumacher
wrote:
> Hi,
>
> I hope this is the correct list for my questi
n error ("attempt to apply non-function") and
> ##
> f2<-function(x) { return(2*x) }(2)
> f2(3)
> ##
> is perfectly fine. Thus the return statement changes the interpretation as
> a function? Or do I miss something?
>
> Best wishes
> Wilm
>
>
> Am 21.10.201
Am 21.10.2016 um 18:10 schrieb William Dunlap:
>
> Are you saying that
f1 <- function(x) log(x)
f2 <- function(x) { log } (x)
should act differently?
yes.
But that would mean that {log} would act differently than log.
I suppose it is a matter of taste, but I say yuck.
As
Another example uses formula.character's other arguments:
> as.formula("env")
Error: object of type 'special' is not subsettable
> as.formula("...")
Error in eval(expr, envir, enclos) : '...' used in an incorrect context
It may happen for the same reason that the following does not give an error:
You can define the data in the R directory. You can keep it all in a *.R
file
by wrapping the text of the *.csv file in quotes and using
read.table(text="quoted stuff"), as in:
theData <- read.csv(header=TRUE, text="
English,Digit
One,1
Two,2
Three,3")
N <- nrow(theData)
You need to make sure 't
While doing some speed testing I noticed that in R-3.2.3 the perl=TRUE
variants of strsplit() and gregexpr() took time proportional to the
square of the number of pattern matches in their input strings. E.g.,
the attached test function times gsub, strsplit, and gregexpr, with
perl TRUE (PCRE) and
If these are identifiers, store them as strings. If not, what sort of
calculations do you plan on doing with them?
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Jan 20, 2017 at 6:33 AM, Nicolas Paris wrote:
> Hello r users,
>
> I have to deal with int8 data with R. AFAIK R does only han
It would be cool if the default for tapply's init.value could be
FUN(X[0]), so it would be 0 for FUN=sum or FUN=length, TRUE for
FUN=all, -Inf for FUN=max, etc. But that would take time and would
break code for which FUN did not work on length-0 objects.
Bill Dunlap
TIBCO Software
wdunlap tibco.co
In addition, signed zeroes only exist for floating point numbers - the
bit patterns for as.integer(0) and as.integer(-0) are identical.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Thu, Jan 26, 2017 at 1:53 AM, Martin Maechler
wrote:
>> Florent Angly
>> on Wed, 25 Jan 2017 16:31:
If you use check.names=FALSE in your call to read.csv you can see that
the first column name starts with the 3 bytes ef bb bf, which is the
UTF-8 "byte-order mark" that Microsoft applications like to put at the
start of a text file stored in UTF-8.
> v0514 <- read.csv(unz(temp, file0514[1]), strin
Were you suppressing warnings? I get a warning along with the "unable
to start device 'png'" in some cases where it fails. E.g., on Linux
> png("Figure1A.png", h = 7, w = 7, res = 1e5, units = "cm")
Error in png("Figure1A.png", h = 7, w = 7, res = 1e+05, units = "cm") :
unable to start device
Control-backslash is the default way to generate SIGQUIT from the
keyboard on Unix and SIGQUIT, by default, aborts the process and
causes it to produce a core dump. Do you want R to catch SIGQUIT?
% stty --all
speed 38400 baud; rows 24; columns 64; line = 0;
intr = ^C; quit = ^\; erase = ^H; kill
dplyr::translate_sql() redefines lots of functions, include "if", to
translate from R syntax to SQL syntax.
> dplyr::translate_sql(if ("mpg">25) "better" else "worse")
CASE WHEN ('mpg' > 25.0) THEN ('better') ELSE ('worse') END
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Sat, Mar 4, 2017 a
Da Zheng would like to override 'if' and 'while' to accept more than
scalar logicals and Martin Maechler would like to change 'if' to
accept only scalar logicals. No one has mentioned '||' and '&&',
which also want scalar logicals.
Perhaps a solution is to have all of these call a new generic
fun
This error can arise when getOption("width") is too small. 80 seems to be the
limit for me with R-3.3.2 on Windows.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Wed, Mar 8, 2017 at 10:28 PM, Spencer Graves
wrote:
> Hello:
>
>
> I tried "debug(help)" with the problem mentioned below. I
something reasonable when the 'indent' argument was too big.
Changing
if (indent > width/2) stop("incorrect values of 'indent' and 'width'")
to
indent <- min(indent, width/2)
seems reasonable to me.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
I noticed that simplify2array acted oddly when given a list of
data.frames of various sizes. If the data.frames have one row, it
makes a new first dimension with the dimname equal to
rownames(firstDataframe). That dimension does not appear for
data.frames with other numbers of rows.
> str(dimnam
I am biased against introducing new syntax, but if one is
experimenting with it one should make sure the precedence feels right.
I think the unary and binary minus-sign operators have different
precedences so I see no a priori reason to make the unary and binary
%xxx% operators to be the same.
Bill
>> I think SPECIALS are already have the proper precedence for both unary
>> and binary calls. Namely higher than all the binary operators (except
>> for `:`), but lower than the other unary operators. Even if we gave
>> unary specials their own precedence I think it would end
expected. I'm confused by this given what I understand the
> purpose to be, but that probably just means I'm not the right person to ask.
>
> Hope that helps.
>
> Best,
> ~G
>
>
>
>
>
>
>
>
>
>
> On Fri, Mar 17, 2017 at 8:55 AM, William D
thout
>> > fully
>> > doing so. See the roxygen comments in Hadley and Lionel's rlang package
>> > here: https://github.com/hadley/rlang/blob/master/R/tidy-unquote.R
>> >
>> > The desired precedence of such a unary operator is not clear to me. The
>> > way
>>
tors (except
>>> for `:`), but lower than the other unary operators. Even if we gave
>>> unary specials their own precedence I think it would end up in the
>>> same place.
>>>
>>> `%l%` <- function(x) tail(x, n = 1)
>>> %l% 1:5
>>&
> void dnk_c(double *sortedFsample, unsigned long int n, unsigned
long int k, double *dKol)
All arguments to C functions called by .C() must be pointers. Also, R
integers are C ints, not unsigned long ints.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Mon, Mar 20, 2017 at 5:55 AM, Hristo In
> Or is this a bad idea?
I don't like the proposal. I have seen code like the following (in
fact, I have written such code, where I had forgotten a function was
not vectorized) where the error would have been discovered much later
if outer() didn't catch it.
> outer(1:3, 11:13, sum)
Error in
>I think that the suggestion I made, in response to a posting by Barry
>>Rowlingson, that the first argument of lapply() be given the name of ".X"
>rather >than just-plain-X, would be (a) effective, and (b) harmless.
It would break any call to *apply() that used X= to name the first
argument. T
In S+ on Unix-alikes we dealt with this issue by using fcntl(fd,
F_SETFD, 1) to set the close-on-exec flag on a file descriptor as soon
as we opened it.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Wed, Apr 19, 2017 at 8:40 PM, Winston Chang wrote:
> In addition to the issue of a child proces
I recently noticed a change between R-3.3.3 and R-3.4.0 in the definition
of the R_CMethodDef struct.
typedef struct {
const char *name;
DL_FUNC fun;
int numArgs;
-
R_NativePrimitiveArgType *types;
- R_NativeArgStyle *styles;
-
} R_CMethodDef;
I
The Ubuntu machine I use a lot (along with others) must not be cleaning
/tmp as it has a fair number of Rtmp* directories in /tmp, even when there
are no R sessions running on the machine. I would like to automate their
removal but there is no obvious way to see if the R process that created
the t
hink I set mine to three days, and I can';t recall ever having a
> problem that was more than a minor annoyance (help breaking) on old R
> processes.
>
> Cheers,
>
> Brian
>
> --
> Brian G. Peterson
> http://braverock.com/brian/
> Ph: 773-459-4973
> IM: bgpbrav
Some formula methods for S3 generic functions use the idiom
returnValue$call <- sys.call(sys.parent())
to show how to recreate the returned object or to use as a label on a
plot. It is often followed by
returnValue$call[[1]] <- quote(myName)
E.g., I see it in packages "latticeExtra" and "
:36 AM, William Dunlap via R-devel
> wrote:
> > Some formula methods for S3 generic functions use the idiom
> > returnValue$call <- sys.call(sys.parent())
> > to show how to recreate the returned object or to use as a label on a
> > plot. It is often foll
While you are fiddling with stopifnot(), please consider changing the form
of the error thrown so that it includes the caller's call. The change
would be from something like
stop( <> )
to
stop(simpleError( <>, sys.call(-1)))
For the following code
f <- function(x, y) {
stopifnot(x > y
Here are three reasons for converting Fortran code, especially older
Fortran code, to C:
1. The C-Fortran interface is not standardized. Various Fortran compilers
pass logical and character arguments in various ways. Various Fortran
compilers mangle function and common block names in variousl wa
If you are changing the parser (which is a major change) you
might consider treating strings in the C/C++ way:
char *s = "A"
"B";
means the same as
char *s = "AB";
I am not a big fan of that syntax but it is widely used.
A backslash at the end of the line leads to errors
You can avoid the warnings and the unneeded calls to FUN by adding
drop=TRUE to the call to ave(), since all of its ... arguments are passed
to interaction (I think).
In TERR we dealt with this problem by adding drop=TRUE to ave's
argument list and we pass ... and drop=drop to interaction. I'm no
But R "integers" are C "ints", as opposed to S "integers", which are C
"long ints". (I suppose R never had to run on ancient hardware with 16 bit
ints.)
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Jun 16, 2017 at 10:47 AM, Yihui Xie wrote:
> Yeah, that was what I heard from our instru
dunlap tibco.com
On Fri, Jun 16, 2017 at 11:53 AM, peter dalgaard wrote:
>
> Wikipedia claims that C ints are still only guaranteed to be at least 16
bits, and longs are at least 32 bits. So no, R's integers are long.
>
> -pd
>
> > On 16 Jun 2017, at 20:20 , William Dun
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
er
>The function Rmpi::mpi.bcast.cmd() calls eventually something along the
lines of
>
>> scmd <- scmd <- substitute(cmd)
>> arg <- list(...)
>> scmd.arg <-serialize(list(scmd=scmd, arg=arg), NULL)
>> if (length(scmd.arg$args) > 0)
>>do.call(as.character(scmd.arg$scmd), scmd.arg$args, envir =
.Glo
How should R deal with matrices that have a 'names' attribute? S (and S+)
did not allow an object to have both dims and names but R does. However,
some R functions copy the dims but not the names to the returned value and
some copy both. I don't see a pattern to it. Is there a general rule for
1: substitute(), when given an argument to a function (which will be a
promise) gives you the unevaluated expression given as the argument:
> L <- list(a=1, b=2, c=3)
> str(lapply(L, function(x) substitute(x)))
List of 3
$ a: language X[[i]]
$ b: language X[[i]]
$ c: language X[[i]]
The 'X' a
>
> Now for the context my question arose in: given a function
>
>loader <- function(package, quietly = TRUE) {
>
>wrapper <- if (quietly) suppressPackageStartupMessages else `{`
>
>expr <- substitute(wrapper(library(package = package)))
>
[[1]]
>[[1]][[1]]
>y
>
>[[1]][[2]]
>X[[1L]]
>
> in any case, the lesson seems to be that quote and substitute are not
> interchangeable, even though for example
>
>> (function() identical(quote({a}), substitute({a})))()
>[1] TRUE
>
>
>
Should arithmetic operations work on zero-column data.frames (returning a
zero-column data.frame with the same number of rows as the data.frame
argument(s))? Currently we get:
> 1 + data.frame(row.names=c("A","B"))
Error in data.frame(value, row.names = rn, check.names = FALSE, check.rows
= FALS
When I mistakenly use file.copy() with a directory for the 'from' argument
and a non-directory for the 'to' and overwrite=TRUE, file.copy returns
FALSE, meaning it could not do the copying. However, it also replaces the
'to' file with a zero-length file.
dir.create( fromDir <- tempfile() )
cat(fi
Bug 17337. Note that I get R making the zero-length file on both Windows
and Linux, but the return values are different.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Mon, Sep 11, 2017 at 7:01 AM, Martin Maechler wrote:
> >>>>> William Dunlap via R-devel
> >>&g
Splus used a similar method for sampling from "bigdata" objects. One
problem was that sample() is used both for creating a sample and for
scrambling the order of a vector. Scrambling the order of a big vector
wastes time. It would be nice to be able to tell sample() that we don't
care about the
Does it work if you supply the closing parenthesis on the call to boxM?
The parser says the input is incomplete and a missing closing parenthesis
would cause that error..
// create a string command with that variable name.String boxVariable =
"boxM(boxMVariable [,-5], boxMVariable[,5]";
// try to
The random numbers in a stream initialized with one seed should have about
the desired distribution. You don't win by changing the seed all the
time. Your seeds caused the first numbers of a bunch of streams to be
about the same, but the second and subsequent entries in each stream do
look unifor
This issue was
> discovered completely by chance when the output of the API was observed to
> be highly non-random. It is possible that it is a 1/10^8 chance, but that
> is hard to believe, given that the API hit depends on user input. Note also
> that the issue goes away when we use a diffe
I was looking at the CRAN package 'bfork-0.1.2', which exposes the Unix
fork() and waitpid() calls at the R code level, and noticed that the help
file example for bfork::fork removes R's temporary directory, the value of
tempdir(). I think it happens because the forked process shares the value
of
eck = TRUE the default though.
>
> /Henrik
>
> On Wed, Nov 8, 2017 at 4:43 PM, William Dunlap via R-devel
> wrote:
> > I was looking at the CRAN package 'bfork-0.1.2', which exposes the Unix
> > fork() and waitpid() calls at the R code level, and noticed that the help
>
The following example involves a function whose on.exit()
expression both generates an error and catches the error.
The body of the function also generates an error.
When calling the function wrapped in a tryCatch, should
that tryCatch's error function be given the error from the
body of the funct
("string")
#[error] caught simpleError/error/condition : pb. in f0's on.exit
#[1] "[error] caught simpleError/error/condition : pb. in f0's on.exit"
catch(f1) # calls stop(conditionObject)
#[error] caught simpleError/error/condition : pb. in f1's on.exit
#[1] "[error]
Is source() the right place for this? It may be, but we've had customers
who would like
this sort of thing done for commands entered by hand. And there are those
who want
a description of any "non-triivial" objects created in .GlobalEnv by each
expression, ...
Do they need a way to wrap each expr
Currently, when mget() is used to get the value of a function's argument
with no default value and no value in the call it returns the empty name
(R_MissingArg). Is that the right thing to do or should it return
'ifnotfound' or give an error?
E.g.,
> a <- (function(x) { y <- "y from function's en
Consider the following expression, in which we pass 'i=', with no value
given for the 'i' argument, to lapply.
lapply("x", function(i, j) c(i=missing(i),j=missing(j), i=)
>From R-2.14.0 (2011-10-31) through R-3.4.4 (2018-03-15) this evaluated to
c(i=TRUE, j=FALSE). From R-3.5.0 (2018-04-23) th
I know that binary packages are R-version specific, but it was a bit
surprising that Rcpp 1.0.5 built with R-4.0.2 cannot be loaded into
R-4.0.0.
% R-4.0.0 --quiet
> library(Rcpp, lib="lib-4.0.2")
Error: package or namespace load failed for ‘Rcpp’ in dyn.load(file,
DLLpath = DLLpath, ...):
unable
I assume you are concerned about this because the formula is defined
in one environment and the model fitting with weights occurs in a
separate function. If that is the case then the model fitting
function can create a new environment, a child of the formula's
environment, add the weights variable
Splus's rle() also grouped NA's (separately from NaN's):
% Splus
TIBCO Software Inc. Confidential Information
Copyright (c) 1988-2008 TIBCO Software Inc. ALL RIGHTS RESERVED.
TIBCO Spotfire S+ Version 8.1.1 for Linux 2.6.9-34.EL, 32-bit : 2008
> dput(rle(c(11,11,NA,NA,NA,NaN,14,14,14,14)))
list("l
401 - 499 of 499 matches
Mail list logo