Displaying 20 results from an estimated 4000 matches similar to: "R-alpha: R <-> S compatibility; more demos -- using S-plus validate(..) .."
2008 Aug 14
3
extending the derivs table/fools rushing in
I added "plogis" to the derivative table in the
development version of R; the patch against yesterday's
R-devel src/deriv/main.c is available at
http://www.zoology.ufl.edu/bolker/deriv_patch.txt .
I pretty much followed the framework of the other symbols;
here was my incantation
- } else if (CAR(expr) == PlogisSymbol) {
- ans = simplify(TimesSymbol,
-
1997 May 25
1
R-alpha: cat
Kurt,
here's what S does (I recall going to some effort to duplicate the,
at times, seemingly unusual behaviour of cat)
S-PLUS : Copyright (c) 1988, 1996 MathSoft, Inc.
S : Copyright AT&T.
Version 3.4 Release 1 for Sun SPARC, SunOS 4.1.3_U1 : 1996
Working data will be in /users/rdev/rgentlem/.Data
> x <- factor(c(1:3, NA), exclude=numeric(0))
> x
[1] 1 2 3 NA
>
2009 Sep 29
3
How do I access class slots from C?
Hi
I'm trying to implement something similar to the following R snippet using
C. I seem to have hit the wall on accessing class slots using C.
library(fPortfolio)
lppData <- 100 * LPP2005.RET[, 1:6]
ewSpec <- portfolioSpec()
nAssets <- ncol(lppData)
setWeights(ewSpec) <- rep(1/nAssets, times = nAssets)
ewPortfolio <- feasiblePortfolio(
data = lppData,
spec = ewSpec,
2010 Aug 21
1
Speed improvement to evalList
I've been inspired to look at the R source code by some strange timing
results that I wrote about on my blog at radfordneal.wordpress.com
(see the posts on "Speeding up parentheses..." and "Two surprising
things...".
I discovered that the strange speed advantage of curly brackets over
parentheses is partially explained by an inefficiency in the evalList
and
2017 Jan 04
4
seq.int/seq.default
On 1/4/17 1:26 AM, Martin Maechler wrote:
>>>>>> Mick Jordan <mick.jordan at oracle.com>
>>>>>> on Tue, 3 Jan 2017 07:57:15 -0800 writes:
> > This is a message for someone familiar with the implementation.
> > Superficially the R code for seq.default and the C code for seq.int
> > appear to be semantically very
2008 Oct 24
1
changed behaviour of 'get' in 2.8.0: request for unchange
There is an unannounced and non-backwards-compatible change to the behaviour of 'get' in R2.8.0. 'get'ting a missing value now causes an error, whereas hitherto it's just returned a "missing" object. For example, in R2.8.0 this happens:
test> getto <- function( x) get( 'x', sys.frame(1))
test> getto()
Error in get("x", sys.frame(1)) :
2020 Jun 23
1
mget(missingArgument)?
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 environment";
mget(c("x","y","z"),
2002 May 01
1
compiling R-1.5.0, package methods, on Solaris 5.7
Compiling package methods, R-1.5.0, on Solaris 5.7 failed (output below)
for me with
- gcc-2.95.3, perl-5.005_03
and also
- gcc-3.0.4, perl-5.6.1
Any ideas a) what the problem is or even better b) how to solve it?
Uwe Ligges
===================================
[...]
building package 'methods'
../../../library/methods/man/methods.Rd is unchanged
making do_substitute_direct.d from
2003 Dec 05
2
s-plus to R
Hi, I have a piece of code originally written for s-plus - I am trying to
run it in R now. The code was obtained from someone who is now not
available to give any pointers and I am a beginner in R. Here is where it
is getting stuck:
> +names(good.motifs[,1])
Error in +names(good.motifs[, 1]) : Invalid argument to unary operator
here is now names(good.motifs,1]) looks:
>
2009 Dec 16
2
What is the fastest way to see what are in an RData file?
Currently, I load the RData file then ls() and str(). But loading the file
takes too long if the file is big. Most of the time, I only interested what
the variables are in the the file and the attributes of the variables (like
if it is a data.frame, matrix, what are the colnames/rownames, etc.)
I'm wondering if there is any facility in R to help me avoid loading the
whole file.
2014 Mar 06
1
Create dataframe in C from table and return to R
Hi ,
I am trying to create a dataframe in C and sebd it back to R. Can anyone
point me to the part of the source code where it is doing , let me explain
the problem I am having .
--------------------------------------------------------------------
My simple implementation is like this
SEXP formDF() {
SEXP dfm ,df , dfint , dfStr,lsnm;
char *ab[3] =
1997 Jul 17
0
R-alpha: functionality of CASIM: C/S-Plus interface
Some people here have started using CASIM, which is an add-on we got a
while back for S-Plus that allows one to spawn an S-Plus process from a C
program and communicate with it.
How hard do folks think it would be to develop such an interface for R?
I might try it, but I'm not completely sure I'm up to it (although it
would exercise my programming skills).
Also, I wonder again at the
1997 Aug 20
1
R-alpha: R-0.50-a3: [logical, drop = FALSE] -- bug in R (and S-plus)
This is a bug both in R and S-plus (in R it's "worse"), I think.
Look at this :
ma <- cbind(1,1:8); logi <- rep(c(T,F),4)
ma[logi,]
##> [,1] [,2]
##> [1,] 1 1
##> [2,] 1 3
##> [3,] 1 5
##> [4,] 1 7
##-- now the same with [ , drop = FALSE]
## R (-0.50-a3) :
ma[logi, drop = F]
##>> Error: invalid subscript type
##
1997 Oct 09
0
R-alpha: [sboker@calliope.psych.nd.edu: Re: S-PLUS on UNIX plans]
--Multipart_Thu_Oct__9_10:41:03_1997-1
Content-Type: text/plain; charset=US-ASCII
In case you did not realize how much this is related to R :
--Multipart_Thu_Oct__9_10:41:03_1997-1
Content-Type: message/rfc822
Return-Path: s-sender@utstat.toronto.edu
From: "Steven M. Boker" <sboker@calliope.psych.nd.edu>
Date: Wed, 8 Oct 97 16:37:05 -0500
To: s-news@utstat.toronto.edu
Subject:
2004 Sep 10
2
rpms
--- Miles Egan <miles@caddr.com> wrote:
> Are there rpms for flac available?
I'm not aware of any official maintainers but supposedly
the gstreamer guys (http://gstreamer.sf.net) have a spec
file for it. I am going to look into it in the next
couple of days but when 1.0 comes out I'm sure RPMs will
pop up pretty quickly.
Josh
__________________________________________________
1997 May 09
2
R-alpha: R-0.49 / S-plus: "default argument evaluation" bugs and woes
There is a problem with 'default argument evaluation'
when I use an existing function name as argument name :
sintest <- function(x, y = 2, sin= sin(pi/4))
{
## Purpose: Test of "default argument evaluation"
## -------- Fails for R-0.49. Martin Maechler, Date: 9 May 97.
c(x=x, y=y, sin=sin)
}
## R-0.49:
R> sintest(1)
##> Error in sintest(1) : recursive
1999 Jan 25
1
COMMERCIAL: S-PLUS Data Analysis Software now Available on Linux (fwd)
I thought R users might be interested (surprised) to hear that R will have
some competition on Linux now.
Bill
---------- Forwarded message ----------
Date: Sun, 24 Jan 1999 01:37:15 GMT
From: Cheryl Mauer <cmauer at statsci.com>
Newsgroups: comp.os.linux.announce
Subject: COMMERCIAL: S-PLUS Data Analysis Software now Available on Linux
Followup-To: comp.os.linux.misc
-----BEGIN PGP
2002 Jan 07
1
Mishandling missing "..." (PR#1247)
R> myfun <- function(x, ...) {x[...] <- 0; x}
R> myfun(3)
Error in myfun(3) : SubAssignArgs: invalid number of arguments
It fails because no ... was passed. The workaround (and desired behavior) is:
R> myfun <- function(x, ...) {if (missing(...)) x[] <- 0 else x[...] <- 0; x}
R> myfun(3)
[1] 0
Deja vu? This is the one piece of my PR#1110 (Oct 3, 2001) that I
2023 Nov 15
1
saveRDS()/readRDS() on environments
Dear r-devel,
I was surprised to see that saveRDS() and readRDS() work quite well with
environments, see below:
```
z <- 3 # in global env
y <- new.env()
y$a <- 1
x <- new.env(parent = y)
x$b <- 2
saveRDS(x, "x.RDS")
# in a new session
x <- readRDS("x.RDS")
y <- parent.env(x)
x$b
#> [1] 2
y$a
#> [1] 1
parent.env(y)
#> <environment:
2010 Jun 19
1
more powerful iconv
R community,
As you may know, R's iconv doesn't work well converting to and from
encodings that allow embedded nulls. For example
> iconv("foo", to="UTF-16")
Error in iconv("foo", to = "UTF-16") :
embedded nul in string: '\xff\xfef\0o\0o\0'
However, I don't believe embedded nulls are at issue here, but rather
that R's iconv