'Writing R Extensions', section 1.1.5, in the part about a package's 'inst'
directory, says that if NEW is in both the top level and in the inst
directory, the in inst will be installed:
Note that with the exceptions of INDEX, LICENSE/LICENCE and NEWS,
information files at the top level of the
[The package XML is labelled ORPHANED and a comment says the CRAN team
maintains it. I am not sure what address to send this to.]
In package XML version 3.98.1.11, RUtils.c registers the C function
RS_XML_xmlNodeChildrenReferences twice. The registration information is
identical but this could
at give rise to the lack of
> reproducibility
> > across architectures. The choice of basis appears to use different
> > heuristics on 32-bit windows than on 64-bit Windows or Linux machines.
> As a
> > result, I can't include the tests I'd like as part of a CRAN submission.
> >
In R-3.5.0 you can use ...length():
> f <- function(..., n) ...length()
> f(stop("one"), stop("two"), stop("three"), n=7)
[1] 3
Prior to that substitute() is the way to go
> g <- function(..., n) length(substitute(...()))
> g(stop("one"), stop("two"), stop("three"), n=7)
[1] 3
You run into the same problem when using 'non-syntactical' names:
> mfB <- model.frame(y ~ `Temp(C)` + `Pres(mb)`,
data=data.frame(check.names=FALSE, y=1:10, `Temp(C)`=21:30,
`Pres(mb)`=991:1000))
> match(attr(terms(mfB), "term.labels"), names(mfB)) # gives NA's
[1] NA NA
> attr(terms(mfB),
The withr package has a bunch of simple functions executing code in various
contexts, e.g., in a given directory or with given options() settings:
> withr::with_dir
function (new, code)
{
old <- setwd(dir = new)
on.exit(setwd(old))
force(code)
}
> withr::with_dir(tempdir(), getwd())
Recent versions of Windows will remove empty directories from areas that
Windows considers places for temporary files. It does not seem to matter
how old they are; empty directories are found and removred c. once a day.
I haven't seen any documentation on this feature but I think you can turn
if
oo many R startup tweaking
> possibilities, notably via environment variables.
> [e.g., the current ways to pre-determine the active .libPaths() in R,
> and the fact the R calls R again during 'R CMD check' etc,
> sometimes drives me crazy when .libPaths() become incompatible
> for
A coworker got tired of having to type 'yes' or 'no' after quitting R: he
never wanted to save the R workspace when quitting. So he added
assignInNamespace lines to his .Rprofile file to replace base::q with
one that, by default, called the original with save="no"..
data(package="survival") gives, in part,
cgd Chronic Granulotomous Disease data
cgd0 (cgd) Chronic Granulotomous Disease data
colon Chemotherapy for Stage B/C colon cancer
flchain Assay of serum free light chain for 7874
The problem occurs in the Windows GUI with the 'windows()' graphics device.
In the following example the red diagonal line appears in 3 plots but not
in the one
with xpd=TRUE and alpha.f=0.9.
> par(mfrow=c(2,2))
> for(xpd in c(FALSE, TRUE)) for(alpha.f in c(.9, 1))
I have a package that lets a user log into another system
and I want it to be sure to log the user out, at least by the
time the R session is over.
My Login(username,password) function stashes a token
(the username in my simplfied code) in an environment
and my Logout() function needs to use that
I believe this has to do terms() making "term.labels" (hence the dimnames
of "factors")
with deparse(), so that the backquotes are included for non-syntactic
names. The backquotes
are not in the column names of the input data.frame (nor model frame) so
you get a mismatch
when subscripting the
I think the problem in R-devel happens when there are non-ASCII characters
in any
of the strings passed to gsub.
txt <- vapply(list(as.raw(c(0x41, 0x6d, 0xc3, 0xa9, 0x6c, 0x69, 0x65)),
as.raw(c(0x41, 0x6d, 0x65, 0x6c, 0x69, 0x61))), rawToChar, "")
txt
#[1] "Amélie" "Amelia"
Encoding(txt)
#[1]
In the fastmatch package, version 1.1-0, there is a C function called
"ctapply_", with a trailing underscore. However, the NAMESPACE's call to
useDynLib refers to "ctapply", without the trailing underscore.
% grep ctapply NAMESPACE {R,src}/*
NAMESPACE:useDynLib(fastmatch, C_fmatch = fmatch,
SEXP eta = PROTECT(allocVector(REALSXP,H_c)); n_prot++;
double *eta_c; eta_c = REAL(eta);
for (i=0;i
On Linux you can trace all the getenv calls with ltrace. It only
works on ELF files, not sh scripts:
% R CMD ltrace -e getenv `R RHOME`/bin/*/R
libR.so->getenv("R_HOME")
= "/home/R/R-3.4.3/lib64/R"
libR.so->getenv("R_TRANSLATIONS")
= nil
> From: R-devel [mailto:r-devel-boun...@r-project.org] On Behalf Of Hervé
> Pagès
> Sent: Monday, January 22, 2018 2:01 PM
> To: William Dunlap <wdun...@tibco.com>; Patrick Perry <
> ppe...@stern.nyu.edu>
> Cc: r-devel@r-project.org
> Subject: Re: [Rd] as.char
I believe that for a list as.character() applies deparse() to each element
of the list. deparse() does not preserve NA-ness, as it is intended to
make text that the parser can read.
> str(as.character(list(Na=NA, LglVec=c(TRUE,NA),
Function=function(x){x+1})))
chr [1:3] "NA" "c(TRUE, NA)"
The x and y passed to dgemm in that code are pointers to the same memory,
thus breaking Fortran's no-aliasing rule. Is it possible the MKL depends
on the
caller following that rule?
You might try dsyrk() instead of dgemm.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Mon, Jan 8, 2018 at 6:57
I think that assigning something to parent.frame() is bad practice, for the
same reasons that assigning to .GlobalEnv is bad. You could instead make
an environment in your package called, say, "TSEtools.env", with
TSETools.env <- new.env()
in some *.R file in the package's R directory.
I have never used this construct. However, part of my job is seeing how
well CRAN packages work in our reimplementation of the R language
and I am continually surprised by the inventiveness of package writers.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Thu, Jan 4, 2018 at 1:44 PM, Ben
One use case is when you want to extract every third item, starting with
the second, of an arbitrary vector with
x[c(FALSE, TRUE, FALSE)]
instead of
x[seq_along(x) %% 3 == 2]
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Thu, Jan 4, 2018 at 11:56 AM, Ben Bolker
, bsize, bmat, rmat, nfrail, y);
}
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Dec 29, 2017 at 8:48 AM, William Dunlap <wdun...@tibco.com> wrote:
> Try changing
> static void (*fun)() = NULL;
> to
> DL_FUNC fun = NULL;
>
> Bill Dunlap
> TIBCO Software
> wdu
Try changing
static void (*fun)() = NULL;
to
DL_FUNC fun = NULL;
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Dec 29, 2017 at 5:14 AM, Therneau, Terry M., Ph.D. <
thern...@mayo.edu> wrote:
> I've recently updated the coxme package, which calls internal routines
> from the bdsmatrix
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
ing")
#[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] caught simpleError/err
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
You wrote
Exited with status -1073741819.
The low byte of that status code is 5, which I think means a segmentation
fault - reading
or writing an address that you do not have permission of use.
> as.hexmode(-1073741819)
[1] "c005"
If your code uses memory that it has not allocated it
's a plan to make check = TRUE the default though.
>
> /Henrik
>
> On Wed, Nov 8, 2017 at 4:43 PM, William Dunlap via R-devel
> <r-devel@r-project.org> wrote:
> > I was looking at the CRAN package 'bfork-0.1.2', which exposes the Unix
> > fork() and waitpid() calls
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
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 us
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
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
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
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 <maech...@stat.math.ethz.ch
> wrote:
> >>>>> Willi
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() )
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
=
te(y), substitute(y)))
>[[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})))()
>
;
> 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)))
>
&g
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'
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
>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 =
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
re
wdunlap tibco.com
On Fri, Jun 16, 2017 at 11:53 AM, peter dalgaard <pda...@gmail.com> 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
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
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
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
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 >
gt;
wrote:
> On Wed, May 10, 2017 at 2:36 AM, William Dunlap via R-devel
> <r-devel@r-project.org> 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
9-4973
> IM: bgpbraverock
>
> On Wed, 2017-04-26 at 08:25 -0700, William Dunlap via R-devel wrote:
> > 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
> > the
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
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
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
>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.
> 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
> 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
>>> 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 up in the
>>> same place.
>>>
>>> `%l
ecture on my part.
>
> Best,
> ~G
>
> On Fri, Mar 17, 2017 at 12:53 PM, William Dunlap <wdun...@tibco.com> wrote:
>>
>> Your example
>>x = 5
>>exp = parse(text="f(uq(x)) + y +z") # expression: f(uq(x)) +y + z
>>do_
; would have 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
precedence I think it would end up in the
>> same place.
>>
>> `%l%` <- function(x) tail(x, n = 1)
>> %l% 1:5
>> #> [1] 5
>> %l% -5:-10
>> #> [1] -10
>>
>> On Thu, Mar 16, 2017 at 6:57 PM, William Dunlap <wdu
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.
I don't know about the current Sparc Fortran compilers, but over the
years have learned not to try to pass logicals and character strings
between C and Fortran. I have seen Fortran compilers that treated
integer -1 (all bits 1) as .true. and anything else as .false. and I
have see ones that
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.
>
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
On Thu, Mar 9, 2017 at 7:2
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
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
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
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
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]),
Use conditonMessage() to extract the message from an error, warning,
message, or other 'condition'
For more, see Hadley Wickham's book, "Advanced R":
http://adv-r.had.co.nz/Exceptions-Debugging.html
http://adv-r.had.co.nz/beyond-exception-handling.html
Bill Dunlap
TIBCO Software
wdunlap
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
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
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
MAKEFLAGS='CXXFLAGS=-std=c++0x -O2' R CMD SHLIB
passes two items, 'CXXFLAGS=-std=c++0x' and '-O2', not the single item
'CXXFLAG=-std=c++0x -O2', to make. Suitably recent versions of GNU
make take the make argument -O2 to control the 'output-sync'.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
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
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
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
The MGGM package has the following in src/Makevars.win to tell the linker
to link with the Lapack, BLAS, and Fortran libraries.
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
Its Makevars file is identical - is that Makevars.win really needed? I
don't see Makevars or Makevars.win in your
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
If I were writing a package for factoring integers I might store a vector
of known primes in an environment in my package and have my factoring
functions append to the list when they find some more primes. This works
because there is only one set of of primes (given we stick with ordinary
This is not a complete answer to your problem, but here is an example of
how to make and store messages of a certain class, "lowMessage", and later
print a table of the messages and their counts.
> lowMessage <- function(text, call = sys.call(-1))
{
# make a message of class
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
wrote:
>
> It’s solved! Changing ‘ar’ to ‘$(AR)’ in the Makefile along with adding
> AR="$(AR)" to @(cd libmseed && $(MAKE) static CC="$(CC)"
> CFLAGS="$(CFLAGS)") in the Makevars.win fixed the problem.
>
> Thank you!
> Gillian Sharer
&g
Do you have a Makefile in the directory yourPackage/src/libmseed?
If so, how does it call 'ar' or '$(AR)'?
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Oct 7, 2016 at 3:44 PM, Gillian Sharer
wrote:
> Thank you for your response. I apologize for asking basic
TRUE/FALSE needed
> >
> >
> > Bill Dunlap
> > TIBCO Software
> > wdunlap tibco.com
> >
> > On Wed, Sep 21, 2016 at 2:32 PM, Michael Lawrence
> > <lawrence.mich...@gene.com> wrote:
> >>
> >> The new behavior is that
; wrote:
> The new behavior is 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 <wd
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
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
Lawrence <lawrence.mich...@gene.com
> 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, Willia
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("(.+)
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)
>
m>
> wrote:
> > 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
aN' 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 <wdun...@tibco.com> wrote:
> > It should be the case that tan(pi*x) != tanpi(x) in many cases - that is
> why
&g
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
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 <gmbec...@ucdavis.edu>
wrote:
>
>
> On Thu, Sep 8, 2016 at 10:05 AM, William Dunlap <wdun...@tibco.co
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
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="--> ")
-->
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
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,
101 - 200 of 508 matches
Mail list logo